Changeset 5a1ace0 in opengl-game for shaders


Ignore:
Timestamp:
Feb 16, 2020, 8:18:50 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
2d87297
Parents:
4ece3bf
git-author:
Dmitry Portnoy <dmitry.portnoy@…> (02/14/20 20:41:35)
git-committer:
Dmitry Portnoy <dmitry.portnoy@…> (02/16/20 20:18:50)
Message:

In VulkanGame, add objIndex to scene objects, use it in the scene shader to index into the ssbo, and change the code that copies data to the ssbo to do so for each scene object, not just the first one

File:
1 edited

Legend:

Unmodified
Added
Removed
  • shaders/scene.vert

    r4ece3bf r5a1ace0  
    1818layout(location = 1) in vec3 inColor;
    1919layout(location = 2) in vec2 inTexCoord;
     20layout(location = 3) in uint obj_index;
    2021
    2122layout(location = 0) out vec3 fragColor;
     
    2627   fragTexCoord = inTexCoord;
    2728
    28    gl_Position = ubo.proj * ubo.view * sbo.objects[0].model * vec4(inPosition, 1.0);
     29   gl_Position = ubo.proj * ubo.view * sbo.objects[obj_index].model * vec4(inPosition, 1.0);
    2930}
Note: See TracChangeset for help on using the changeset viewer.