Changes in vulkan-game.cpp [785333b:cf727ca] in opengl-game
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
r785333b rcf727ca 255 255 shipPipeline.addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&ShipVertex::color)); 256 256 shipPipeline.addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&ShipVertex::normal)); 257 shipPipeline.addAttribute(VK_FORMAT_R32_UINT, offset_of(&ShipVertex::objIndex)); 257 258 258 259 createBufferSet(sizeof(UBO_VP_mats), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, … … 268 269 // TODO: With the normals, indexing basically becomes pointless since no vertices will have exactly 269 270 // the same data. Add an option to make some pipelines not use indexing 270 /* 271 shipPipeline.addObject(addVertexNormals<ShipVertex>({ 271 shipPipeline.addObject( 272 addObjectIndex<ShipVertex>(shipPipeline.getObjects().size(), 273 addVertexNormals<ShipVertex>({ 272 274 //back 273 275 {{ -0.5f, 0.3f, 0.0f}, {0.0f, 0.0f, 0.3f}}, … … 465 467 {{ 1.5f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.3f}}, 466 468 {{ 1.3f, 0.0f, -0.3f}, {0.0f, 0.0f, 0.3f}}, 467 }) , {469 })), { 468 470 0, 1, 2, 3, 4, 5, 469 471 6, 7, 8, 9, 10, 11, … … 496 498 135, 136, 137, 497 499 }, commandPool, graphicsQueue); 498 */499 500 // z-range is 0 to 1, with +1 pointing into the screen501 shipPipeline.addObject(addVertexNormals<ShipVertex>({502 {{ 0.5f, -0.5f, 0.5f}, {0.0f, 0.6f, 0.0f}},503 {{ -0.5f, -0.5f, 0.5f}, {0.0f, 0.6f, 0.0f}},504 {{ -0.5f, 0.5f, 0.5f}, {0.0f, 0.6f, 0.0f}},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 509 {{ 0.3f, -0.3f, 0.3f}, {0.0f, 0.0f, 0.7f}},510 {{ -0.3f, -0.3f, 0.3f}, {0.0f, 0.0f, 0.7f}},511 {{ -0.3f, 0.3f, 0.3f}, {0.0f, 0.0f, 0.7f}},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 }), {516 0, 1, 2, 3, 4, 5,517 6, 7, 8, 9, 10, 11,518 }, commandPool, graphicsQueue);519 500 520 501 shipPipeline.createDescriptorSetLayout();
Note:
See TracChangeset
for help on using the changeset viewer.