overlayFragment.fs 383 B

12345678910111213141516171819202122
  1. #version 430
  2. layout (binding = 0) uniform sampler2D samp;
  3. uniform bool useTexture;
  4. uniform bool useColor;
  5. in vec4 varColor;
  6. in vec2 varTextureCoord;
  7. out vec4 color;
  8. void main() {
  9. if(useTexture) {
  10. color = texture(samp, varTextureCoord);
  11. if(useColor) {
  12. color = vec4(varColor.xyz, color.w);
  13. }
  14. } else {
  15. color = varColor;
  16. }
  17. }