- Timestamp:
- Aug 6, 2019, 7:01:45 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 5f3dba8
- Parents:
- bba12e7
- Location:
- shaders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
shaders/shader.frag
rbba12e7 r69dccfe 3 3 4 4 layout(binding = 1) uniform sampler2D texSampler; 5 layout(binding = 2) uniform sampler2D uiTexSampler; 5 6 6 7 layout(location = 0) in vec3 fragColor; 7 8 layout(location = 1) in vec2 fragTexCoord; 9 layout(location = 2) flat in uint isOverlay; 8 10 9 11 layout(location = 0) out vec4 outColor; 10 12 11 13 void main() { 12 outColor = vec4(fragColor * texture(texSampler, fragTexCoord).rgb, 1.0); 14 if (isOverlay == 1) { 15 outColor = vec4(fragColor * texture(uiTexSampler, fragTexCoord).rgb, 0.3); 16 } else { 17 outColor = vec4(fragColor * texture(texSampler, fragTexCoord).rgb, 1.0); 18 } 13 19 } -
shaders/shader.vert
rbba12e7 r69dccfe 14 14 layout(location = 0) out vec3 fragColor; 15 15 layout(location = 1) out vec2 fragTexCoord; 16 layout(location = 2) out uint isOverlay; 16 17 17 18 void 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 20 29 fragTexCoord = inTexCoord; 21 30 }
Note:
See TracChangeset
for help on using the changeset viewer.