Changeset 69dccfe in opengl-game for shaders/shader.vert


Ignore:
Timestamp:
Aug 6, 2019, 7:01:45 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
5f3dba8
Parents:
bba12e7
Message:

Implement a translucent, fullscreen overlay that shows a loaded texture. This will later be used to show a UI rendered by SDL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • shaders/shader.vert

    rbba12e7 r69dccfe  
    1414layout(location = 0) out vec3 fragColor;
    1515layout(location = 1) out vec2 fragTexCoord;
     16layout(location = 2) out uint isOverlay;
    1617
    1718void main() {
    18    gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0);
    19    fragColor = inColor;
     19   if (gl_VertexIndex < 8 ) {
     20      gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0);
     21      fragColor = inColor;
     22      isOverlay = 0;
     23   } else {
     24      gl_Position = vec4(inPosition, 1.0);
     25      fragColor = vec3(0.0, 1.0, 1.0);
     26      isOverlay = 1;
     27   }
     28
    2029   fragTexCoord = inTexCoord;
    2130}
Note: See TracChangeset for help on using the changeset viewer.