unlit.fp 585 B

123456789101112131415161718192021222324252627
  1. #version 140
  2. // Inputs should match the vertex shader's outputs.
  3. in vec2 var_texcoord0;
  4. // The texture to sample.
  5. uniform lowp sampler2D texture0;
  6. // The final color of the fragment.
  7. out lowp vec4 final_color;
  8. uniform fs_uniforms
  9. {
  10. mediump vec4 tint;
  11. };
  12. void main()
  13. {
  14. // Pre-multiply alpha since all runtime textures already are
  15. vec4 tint_pm = vec4(tint.xyz * tint.w, tint.w);
  16. // Sample the texture at the fragment's texture coordinates.
  17. vec4 color = texture(texture0, var_texcoord0.xy) * tint_pm;
  18. // Output the sampled color.
  19. final_color = color;
  20. }