UiText.glsl 726 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma anki vertShaderBegins
  2. layout(location = 0) in vec2 position;
  3. uniform mat3 transformation; ///< Position transformation
  4. uniform mat3 textureTranformation; ///< Texture transformation
  5. out vec2 vTexCoords;
  6. void main(void)
  7. {
  8. vec3 pos3d = vec3(position, 1.0);
  9. vTexCoords = (textureTranformation * pos3d).xy;
  10. gl_Position = vec4(transformation * pos3d, 1.0);
  11. }
  12. #pragma anki fragShaderBegins
  13. in vec2 vTexCoords;
  14. uniform sampler2D texture;
  15. uniform vec4 color;
  16. layout(location = 0) out vec4 fColor;
  17. void main()
  18. {
  19. float r = texture2D(texture, vTexCoords).r;
  20. fColor = vec4(r) * color;
  21. //fColor = texCol - texCol + vec4(1.0, 0.0, 1.0, 0.1);
  22. //fColor = texCol - texCol + vec4(texture2D(texture, vTexCoords).r);
  23. }