Changeset 914bb99 in opengl-game
- Timestamp:
- Apr 9, 2021, 3:26:38 PM (4 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- a00eb06
- Parents:
- 5049354
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sdl-game.hpp
r5049354 r914bb99 44 44 45 45 class VulkanGame { 46 46 47 public: 48 47 49 VulkanGame(); 48 50 ~VulkanGame(); … … 51 53 52 54 private: 55 53 56 static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback( 54 57 VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, -
vulkan-game.cpp
r5049354 r914bb99 135 135 {{ 0.5f, -0.5f, 0.0f}, {0.0f, 1.0f, 0.0f}, {1.0f, 1.0f}}, 136 136 {{ 0.5f, 0.5f, 0.0f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, 137 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}} 138 }), { 139 0, 1, 2, 2, 3, 0 137 {{ 0.5f, 0.5f, 0.0f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, 138 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}}, 139 {{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}} 140 }), { 141 0, 1, 2, 3, 4, 5 140 142 }, { 141 143 mat4(1.0f) … … 151 153 {{ 0.5f, -0.5f, 0.0f}, {0.0f, 1.0f, 0.0f}, {1.0f, 1.0f}}, 152 154 {{ 0.5f, 0.5f, 0.0f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, 153 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}} 154 }), { 155 0, 1, 2, 2, 3, 0 155 {{ 0.5f, 0.5f, 0.0f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, 156 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}}, 157 {{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}} 158 }), { 159 0, 1, 2, 3, 4, 5 156 160 }, { 157 161 mat4(1.0f) … … 573 577 modelPipeline = GraphicsPipeline_Vulkan<ModelVertex, SSBO_ModelObject>( 574 578 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, physicalDevice, device, renderPass, 575 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, swapChainImages, 16, 24, 10);579 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, swapChainImages, 24, 24, 10); 576 580 577 581 shipPipeline = GraphicsPipeline_Vulkan<ShipVertex, SSBO_ModelObject>( … … 664 668 io.WantCaptureMouse) { 665 669 if (sdlEvent.type == SDL_MOUSEWHEEL || sdlEvent.type == SDL_MOUSEBUTTONDOWN || 666 sdlEvent.type == SDL_MOUSEBUTTONUP) {670 sdlEvent.type == SDL_MOUSEBUTTONUP) { 667 671 continue; 668 672 } … … 703 707 {{ 0.5f, -0.5f, 0.0f}, {0.0f, 1.0f, 0.0f}, {1.0f, 1.0f}}, 704 708 {{ 0.5f, 0.5f, 0.0f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, 705 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}} 709 {{ 0.5f, 0.5f, 0.0f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, 710 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}}, 711 {{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}} 706 712 }), { 707 0, 1, 2, 2, 3, 0713 0, 1, 2, 3, 4, 5 708 714 }, { 709 715 mat4(1.0f) -
vulkan-game.hpp
r5049354 r914bb99 212 212 213 213 class VulkanGame { 214 214 215 public: 215 216 … … 558 559 } 559 560 561 // This function sets all the normals for a face to be parallel 562 // This is good for models that should have distinct faces, but bad for models that should appear smooth 563 // Maybe add an option to set all copies of a point to have the same normal and have the direction of 564 // that normal be the weighted average of all the faces it is a part of, where the weight from each face 565 // is its surface area. 566 567 // TODO: Since the current approach to normal calculation basicaly makes indexed drawing useless, see if it's 568 // feasible to automatically enable/disable indexed drawing based on which approach is used 560 569 template<class VertexType> 561 570 vector<VertexType> VulkanGame::addVertexNormals(vector<VertexType> vertices) {
Note:
See TracChangeset
for help on using the changeset viewer.