fragment.fs 628 B

1234567891011121314151617181920212223242526272829303132
  1. #version 430
  2. layout (binding = 0) uniform sampler2D samp;
  3. uniform mat4 projMatrix;
  4. uniform mat4 viewMatrix;
  5. uniform mat4 modelMatrix;
  6. uniform bool useTexture;
  7. uniform bool useColor;
  8. uniform bool useMixColor;
  9. uniform vec4 mixColor;
  10. uniform bool useNormals;
  11. in vec2 tc;
  12. in vec4 outColor;
  13. out vec4 color;
  14. void main(void) {
  15. if(useTexture) {
  16. color = texture(samp, tc);
  17. if(useColor) {
  18. if(useMixColor) {
  19. color = (color + mixColor) * 0.5;
  20. } else {
  21. color = vec4(outColor.xyz, color.w);
  22. }
  23. }
  24. } else {
  25. color = outColor;
  26. }
  27. }