fragment.fs 368 B

1234567891011121314151617181920212223
  1. #version 300 es
  2. precision highp float;
  3. uniform sampler2D samp;
  4. uniform bool useTexture;
  5. uniform bool useColor;
  6. in vec2 varTex;
  7. in vec4 varColor;
  8. out vec4 color;
  9. void main() {
  10. if(useTexture) {
  11. color = texture(samp, varTex);
  12. if(useColor) {
  13. color = vec4(varColor.xyz, color.r);
  14. }
  15. } else {
  16. color = varColor;
  17. }
  18. }