Changes in / [cf727ca:2b40f48] in opengl-game
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
shaders/ship.frag
rcf727ca r2b40f48 43 43 vec3 Is = Ls * Ks * specular_factor; 44 44 45 outColor = vec4(Is + Id + Ia, 1.0); 45 //outColor = vec4(Is + Id + Ia, 1.0); 46 outColor = vec4(color, 1.0); 46 47 } -
shaders/ship.vert
rcf727ca r2b40f48 40 40 light_position_eye = vec3(ubo.view * vec4(light_position_world, 1.0)); 41 41 42 gl_Position = ubo.proj * vec4(position_eye, 1.0); 42 //gl_Position = ubo.proj * vec4(position_eye, 1.0); 43 gl_Position = vec4(vertex_position, 1.0); 43 44 } -
vulkan-game.cpp
rcf727ca r2b40f48 269 269 // TODO: With the normals, indexing basically becomes pointless since no vertices will have exactly 270 270 // the same data. Add an option to make some pipelines not use indexing 271 /* 271 272 shipPipeline.addObject( 272 273 addObjectIndex<ShipVertex>(shipPipeline.getObjects().size(), … … 498 499 135, 136, 137, 499 500 }, commandPool, graphicsQueue); 501 */ 502 503 // z-range is 0 to 1, with +1 pointing into the screen 504 shipPipeline.addObject(addVertexNormals<ShipVertex>({ 505 {{ 0.5f, -0.5f, 0.5f}, {0.0f, 0.6f, 0.0f}}, 506 {{ -0.5f, -0.5f, 0.5f}, {0.0f, 0.6f, 0.0f}}, 507 {{ -0.5f, 0.5f, 0.5f}, {0.0f, 0.6f, 0.0f}}, 508 {{ 0.5f, -0.5f, 0.5f}, {0.0f, 0.6f, 0.0f}}, 509 {{ -0.5f, 0.5f, 0.5f}, {0.0f, 0.6f, 0.0f}}, 510 {{ 0.5f, 0.5f, 0.5f}, {0.0f, 0.6f, 0.0f}}, 511 512 {{ 0.3f, -0.3f, 0.3f}, {0.0f, 0.0f, 0.7f}}, 513 {{ -0.3f, -0.3f, 0.3f}, {0.0f, 0.0f, 0.7f}}, 514 {{ -0.3f, 0.3f, 0.3f}, {0.0f, 0.0f, 0.7f}}, 515 {{ 0.3f, -0.3f, 0.3f}, {0.0f, 0.0f, 0.7f}}, 516 {{ -0.3f, 0.3f, 0.3f}, {0.0f, 0.0f, 0.7f}}, 517 {{ 0.3f, 0.3f, 0.3f}, {0.0f, 0.0f, 0.7f}}, 518 }), { 519 0, 1, 2, 3, 4, 5, 520 6, 7, 8, 9, 10, 11, 521 }, commandPool, graphicsQueue); 500 522 501 523 shipPipeline.createDescriptorSetLayout();
Note:
See TracChangeset
for help on using the changeset viewer.