texturedmesh.fp 400 B

1234567891011121314151617181920212223
  1. #version 140
  2. in highp vec4 var_position;
  3. in mediump vec2 var_texcoord0;
  4. out vec4 out_fragColor;
  5. uniform mediump sampler2D tex0;
  6. uniform fs_uniforms
  7. {
  8. mediump vec4 tint;
  9. };
  10. void main()
  11. {
  12. // Pre-multiply alpha since all runtime textures already are
  13. vec4 tint_pm = vec4(tint.xyz * tint.w, tint.w);
  14. vec4 color = texture(tex0, var_texcoord0) * tint_pm;
  15. out_fragColor = vec4(color.rgb, 1.0);
  16. }