Changeset 67527a5 in opengl-game for shaders/laser.vert
- Timestamp:
- Jun 21, 2021, 4:12:08 PM (3 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- 27e580e
- Parents:
- b01b50c
- git-author:
- Dmitry Portnoy <dportnoy@…> (06/21/21 15:13:03)
- git-committer:
- Dmitry Portnoy <dportnoy@…> (06/21/21 16:12:08)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
shaders/laser.vert
rb01b50c r67527a5 8 8 }; 9 9 10 layout (binding = 0) uniform UniformBufferObject{10 layout (binding = 0) uniform camera_block { 11 11 mat4 view; 12 12 mat4 proj; 13 } camera; 14 15 layout(binding = 1) uniform ubo_block { 16 Object objects[1024]; 13 17 } ubo; 14 15 layout(binding = 1) readonly buffer StorageBufferObject {16 Object objects[];17 } sbo;18 18 19 19 layout(location = 0) in vec3 vertex_position; … … 25 25 26 26 void main() { 27 vec3 position_eye = vec3( ubo.view * sbo.objects[obj_index_vs].model * vec4(vertex_position, 1.0));27 vec3 position_eye = vec3(camera.view * ubo.objects[obj_index_vs].model * vec4(vertex_position, 1.0)); 28 28 29 29 texcoords_fs = texcoords_vs; 30 30 obj_index_fs = obj_index_vs; 31 31 32 if ( sbo.objects[obj_index_vs].deleted) {32 if (ubo.objects[obj_index_vs].deleted) { 33 33 gl_Position = vec4(0.0, 0.0, 2.0, 1.0); 34 34 } else { 35 gl_Position = ubo.proj * vec4(position_eye, 1.0);35 gl_Position = camera.proj * vec4(position_eye, 1.0); 36 36 } 37 37 }
Note:
See TracChangeset
for help on using the changeset viewer.