source:
opengl-game/shaders/overlay.frag@
d53ef6a
Last change on this file since d53ef6a was e5d4aca, checked in by , 5 years ago | |
---|---|
|
|
File size: 532 bytes |
Rev | Line | |
---|---|---|
[4befb76] | 1 | #version 450 |
2 | #extension GL_ARB_separate_shader_objects : enable | |
3 | ||
[e5d4aca] | 4 | layout(binding = 0) uniform sampler2D uiTexSampler; |
[fba08f2] | 5 | |
[4befb76] | 6 | layout(location = 0) in vec3 fragColor; |
[fba08f2] | 7 | layout(location = 1) in vec2 fragTexCoord; |
[69dccfe] | 8 | layout(location = 2) flat in uint isOverlay; |
[4befb76] | 9 | |
10 | layout(location = 0) out vec4 outColor; | |
11 | ||
12 | void main() { | |
[e5d4aca] | 13 | outColor = texture(uiTexSampler, fragTexCoord); |
14 | ||
[69dccfe] | 15 | if (isOverlay == 1) { |
[5936c58] | 16 | outColor = texture(uiTexSampler, fragTexCoord); |
[69dccfe] | 17 | } else { |
[e5d4aca] | 18 | outColor = vec4(fragColor * texture(uiTexSampler, fragTexCoord).rgb, 1.0); |
[69dccfe] | 19 | } |
[4befb76] | 20 | } |
Note:
See TracBrowser
for help on using the repository browser.