Changeset e5d4aca in opengl-game for shaders


Ignore:
Timestamp:
Aug 22, 2019, 2:19:56 AM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
6544020
Parents:
c8c6da8
Message:

Create separate descriptor pools and descriptor sets for each shader group and start removing unnecessary elements from the overlay shaders

Location:
shaders
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • shaders/overlay.frag

    rc8c6da8 re5d4aca  
    22#extension GL_ARB_separate_shader_objects : enable
    33
    4 layout(binding = 1) uniform sampler2D texSampler;
    5 layout(binding = 2) uniform sampler2D uiTexSampler;
     4layout(binding = 0) uniform sampler2D uiTexSampler;
    65
    76layout(location = 0) in vec3 fragColor;
     
    1211
    1312void main() {
     13   outColor = texture(uiTexSampler, fragTexCoord);
     14
    1415   if (isOverlay == 1) {
    1516      outColor = texture(uiTexSampler, fragTexCoord);
    1617   } else {
    17       outColor = vec4(fragColor * texture(texSampler, fragTexCoord).rgb, 1.0);
     18      outColor = vec4(fragColor * texture(uiTexSampler, fragTexCoord).rgb, 1.0);
    1819   }
    1920}
  • shaders/overlay.vert

    rc8c6da8 re5d4aca  
    11#version 450
    22#extension GL_ARB_separate_shader_objects : enable
    3 
    4 layout (binding = 0) uniform UniformBufferObject {
    5    mat4 model;
    6    mat4 view;
    7    mat4 proj;
    8 } ubo;
    93
    104layout(location = 0) in vec3 inPosition;
     
    1711
    1812void main() {
    19    if (gl_VertexIndex < 8) {
    20       gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0);
     13   if (gl_VertexIndex < 0) {
    2114      fragColor = inColor;
    2215      isOverlay = 0;
    2316   } else {
    24       gl_Position = vec4(inPosition, 1.0);
    25       fragColor = vec3(1.0, 1.0, 1.0);
     17      fragColor = inColor;
    2618      isOverlay = 1;
    2719   }
    2820
    2921   fragTexCoord = inTexCoord;
     22   gl_Position = vec4(inPosition, 1.0);
    3023}
Note: See TracChangeset for help on using the changeset viewer.