source:
opengl-game/shaders/overlay.vert@
e5d4aca
Last change on this file since e5d4aca was e5d4aca, checked in by , 5 years ago | |
---|---|
|
|
File size: 541 bytes |
Rev | Line | |
---|---|---|
[4befb76] | 1 | #version 450 |
[de32fda] | 2 | #extension GL_ARB_separate_shader_objects : enable |
3 | ||
[adcd252] | 4 | layout(location = 0) in vec3 inPosition; |
[80edd70] | 5 | layout(location = 1) in vec3 inColor; |
[fba08f2] | 6 | layout(location = 2) in vec2 inTexCoord; |
[4befb76] | 7 | |
[80edd70] | 8 | layout(location = 0) out vec3 fragColor; |
[fba08f2] | 9 | layout(location = 1) out vec2 fragTexCoord; |
[69dccfe] | 10 | layout(location = 2) out uint isOverlay; |
[4befb76] | 11 | |
12 | void main() { | |
[e5d4aca] | 13 | if (gl_VertexIndex < 0) { |
[69dccfe] | 14 | fragColor = inColor; |
15 | isOverlay = 0; | |
16 | } else { | |
[e5d4aca] | 17 | fragColor = inColor; |
[69dccfe] | 18 | isOverlay = 1; |
19 | } | |
20 | ||
[fba08f2] | 21 | fragTexCoord = inTexCoord; |
[e5d4aca] | 22 | gl_Position = vec4(inPosition, 1.0); |
[4befb76] | 23 | } |
Note:
See TracBrowser
for help on using the repository browser.