Changeset 055750a in opengl-game for shaders/scene.vert


Ignore:
Timestamp:
Dec 4, 2019, 9:33:43 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
785333b, cf727ca
Parents:
e1308e8
Message:

In VulkanGame, use SSBOs in the ship and scene shaders to store per-object data (currently just the model matrix)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • shaders/scene.vert

    re1308e8 r055750a  
    22#extension GL_ARB_separate_shader_objects : enable
    33
     4struct Object {
     5   mat4 model;
     6};
     7
    48layout (binding = 0) uniform UniformBufferObject {
    5    mat4 model;
    69   mat4 view;
    710   mat4 proj;
    811} ubo;
     12
     13layout(binding = 1) readonly buffer StorageBufferObject {
     14    Object objects[];
     15} sbo;
    916
    1017layout(location = 0) in vec3 inPosition;
     
    1926   fragTexCoord = inTexCoord;
    2027
    21    gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0);
     28   gl_Position = ubo.proj * ubo.view * sbo.objects[0].model * vec4(inPosition, 1.0);
    2229}
Note: See TracChangeset for help on using the changeset viewer.