overlayFragment.fs 403 B

123456789101112131415161718192021222324252627
  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. {
  10. if(useTexture)
  11. {
  12. color = texture(samp, varTextureCoord);
  13. if(useColor)
  14. {
  15. color = vec4(varColor.xyz, color.w);
  16. }
  17. }
  18. else
  19. {
  20. color = varColor;
  21. }
  22. }