Changeset 22217d4 in opengl-game
- Timestamp:
- Mar 22, 2020, 10:07:01 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 1add0ed
- Parents:
- 0807aeb
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
gl-shaders/ship.frag
r0807aeb r22217d4 49 49 vec3 Is2 = Ls * Ks * specular_factor2; 50 50 51 frag_color = vec4((Is + Id + Ia + Is2 + Id2 + Ia2) /2, 1.0);51 frag_color = vec4((Is + Id + Ia + Is2 + Id2 + Ia2) / 2.0, 1.0); 52 52 } -
shaders/ship.frag
r0807aeb r22217d4 57 57 vec3 Is2 = Ls * Ks * specular_factor2; 58 58 59 frag_color = vec4((Is + Id + Ia + Is2 + Id2 + Ia2) /2, 1.0);59 frag_color = vec4((Is + Id + Ia + Is2 + Id2 + Ia2) / 2.0, 1.0); 60 60 } -
vulkan-game.cpp
r0807aeb r22217d4 568 568 mat4 R_view = pitch_mat * yaw_mat; 569 569 mat4 T_view = translate(mat4(1.0f), vec3(-cam_pos.x, -cam_pos.y, -cam_pos.z)); 570 mat4 view= R_view * T_view;571 572 mat4 proj= perspective(radians(FOV_ANGLE), (float)swapChainExtent.width / (float)swapChainExtent.height, NEAR_CLIP, FAR_CLIP);573 proj [1][1] *= -1; // flip the y-axis so that +y is up574 575 object_VP_mats.view = view ;576 object_VP_mats.proj = proj ;577 578 ship_VP_mats.view = view ;579 ship_VP_mats.proj = proj ;580 581 asteroid_VP_mats.view = view ;582 asteroid_VP_mats.proj = proj ;570 viewMat = R_view * T_view; 571 572 projMat = perspective(radians(FOV_ANGLE), (float)swapChainExtent.width / (float)swapChainExtent.height, NEAR_CLIP, FAR_CLIP); 573 projMat[1][1] *= -1; // flip the y-axis so that +y is up 574 575 object_VP_mats.view = viewMat; 576 object_VP_mats.proj = projMat; 577 578 ship_VP_mats.view = viewMat; 579 ship_VP_mats.proj = projMat; 580 581 asteroid_VP_mats.view = viewMat; 582 asteroid_VP_mats.proj = projMat; 583 583 } 584 584 -
vulkan-game.hpp
r0807aeb r22217d4 149 149 150 150 bool framebufferResized; 151 152 mat4 viewMat, projMat; 151 153 152 154 GraphicsPipeline_Vulkan<OverlayVertex, void*> overlayPipeline;
Note:
See TracChangeset
for help on using the changeset viewer.