- Timestamp:
- Aug 22, 2019, 2:19:56 AM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 6544020
- Parents:
- c8c6da8
- Location:
- shaders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
shaders/overlay.frag
rc8c6da8 re5d4aca 2 2 #extension GL_ARB_separate_shader_objects : enable 3 3 4 layout(binding = 1) uniform sampler2D texSampler; 5 layout(binding = 2) uniform sampler2D uiTexSampler; 4 layout(binding = 0) uniform sampler2D uiTexSampler; 6 5 7 6 layout(location = 0) in vec3 fragColor; … … 12 11 13 12 void main() { 13 outColor = texture(uiTexSampler, fragTexCoord); 14 14 15 if (isOverlay == 1) { 15 16 outColor = texture(uiTexSampler, fragTexCoord); 16 17 } else { 17 outColor = vec4(fragColor * texture( texSampler, fragTexCoord).rgb, 1.0);18 outColor = vec4(fragColor * texture(uiTexSampler, fragTexCoord).rgb, 1.0); 18 19 } 19 20 } -
shaders/overlay.vert
rc8c6da8 re5d4aca 1 1 #version 450 2 2 #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;9 3 10 4 layout(location = 0) in vec3 inPosition; … … 17 11 18 12 void main() { 19 if (gl_VertexIndex < 8) { 20 gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0); 13 if (gl_VertexIndex < 0) { 21 14 fragColor = inColor; 22 15 isOverlay = 0; 23 16 } else { 24 gl_Position = vec4(inPosition, 1.0); 25 fragColor = vec3(1.0, 1.0, 1.0); 17 fragColor = inColor; 26 18 isOverlay = 1; 27 19 } 28 20 29 21 fragTexCoord = inTexCoord; 22 gl_Position = vec4(inPosition, 1.0); 30 23 }
Note:
See TracChangeset
for help on using the changeset viewer.