vertexcolor.fp 584 B

1234567891011121314151617181920212223242526
  1. #version 140
  2. // Inputs should match the vertex shader's outputs.
  3. in vec4 vertex_color;
  4. // The final color of the fragment.
  5. out lowp vec4 final_color;
  6. uniform fs_uniforms
  7. {
  8. mediump vec4 tint;
  9. };
  10. void main()
  11. {
  12. // brightening up the displayed vertex colors
  13. lowp float brightness = 0.1;
  14. // Pre-multiply alpha for tint
  15. vec4 tint_pm = vec4(tint.xyz * tint.w, tint.w);
  16. // Sample the vertex color from vertices, add a little brightness with tint.
  17. vec4 color = vertex_color + brightness * tint_pm ;
  18. // Output the sampled color.
  19. final_color = color;
  20. }