Changeset 4a9416a in opengl-game for vulkan-game.hpp
- Timestamp:
- Apr 26, 2020, 9:50:00 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master
- Children:
- b8d4456
- Parents:
- 52a02e6
- git-author:
- Dmitry Portnoy <dmitry.portnoy@…> (04/26/20 19:00:18)
- git-committer:
- Dmitry Portnoy <dmitry.portnoy@…> (04/26/20 21:50:00)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.hpp
r52a02e6 r4a9416a 57 57 }; 58 58 59 struct ExplosionVertex { 60 vec3 particleStartVelocity; 61 float particleStartTime; 62 unsigned int objIndex; 63 }; 64 59 65 struct SSBO_ModelObject { 60 66 alignas(16) mat4 model; … … 73 79 }; 74 80 81 struct SSBO_Explosion { 82 alignas(16) mat4 model; 83 alignas(4) float explosionStartTime; 84 alignas(4) float explosionDuration; 85 alignas(4) unsigned int deleted; 86 }; 87 75 88 struct UBO_VP_mats { 76 89 alignas(16) mat4 view; 77 90 alignas(16) mat4 proj; 91 }; 92 93 struct UBO_Explosion { 94 alignas(16) mat4 view; 95 alignas(16) mat4 proj; 96 alignas(4) float cur_time; 78 97 }; 79 98 … … 183 202 const float FOV_ANGLE = 67.0f; // means the camera lens goes from -33 deg to 33 def 184 203 204 const int EXPLOSION_PARTICLE_COUNT = 300; 205 const vec3 LASER_COLOR = vec3(0.2f, 1.0f, 0.2f); 206 185 207 vec3 cam_pos; 186 208 … … 287 309 288 310 UBO_VP_mats laser_VP_mats; 311 312 GraphicsPipeline_Vulkan<ExplosionVertex, SSBO_Explosion> explosionPipeline; 313 vector<SceneObject<ExplosionVertex, SSBO_Explosion>> explosionObjects; 314 315 vector<VkBuffer> uniformBuffers_explosionPipeline; 316 vector<VkDeviceMemory> uniformBuffersMemory_explosionPipeline; 317 vector<VkDescriptorBufferInfo> uniformBufferInfoList_explosionPipeline; 318 319 UBO_Explosion explosion_UBO; 289 320 290 321 vector<BaseEffectOverTime*> effects; … … 368 399 vec3& start, vec3& end, vec3& intersection); 369 400 401 void addExplosion(mat4 model_mat, float duration, float cur_time); 402 370 403 void createBufferSet(VkDeviceSize bufferSize, VkBufferUsageFlags flags, 371 404 vector<VkBuffer>& buffers, vector<VkDeviceMemory>& buffersMemory, … … 382 415 void* pUserData); 383 416 }; 417 418 // Start of specialized no-op functions 419 420 template<> 421 inline void VulkanGame::centerObject(SceneObject<ExplosionVertex, SSBO_Explosion>& object) { 422 } 423 424 // End of specialized no-op functions 384 425 385 426 // TODO: Right now, it's basically necessary to pass the identity matrix in for ssbo.model … … 409 450 SceneObject<VertexType, SSBOType>& obj = objects.back(); 410 451 411 if (!is_same_v<VertexType, LaserVertex> ) {452 if (!is_same_v<VertexType, LaserVertex> && !is_same_v<VertexType, ExplosionVertex>) { 412 453 centerObject(obj); 413 454 }
Note:
See TracChangeset
for help on using the changeset viewer.