sprite-frag.glsl 394 B

123456789101112131415161718192021222324252627
  1. #version 300 es
  2. precision mediump float;
  3. precision lowp sampler2DArray;
  4. in vec2 tex_vs;
  5. flat in float alpha_vs;
  6. flat in float tex_index_vs;
  7. out vec4 outColor;
  8. uniform sampler2DArray sTex;
  9. void main() {
  10. vec4 d = texture(sTex, vec3(tex_vs, tex_index_vs));
  11. float a = d.a * alpha_vs;
  12. if(a < 0.005) discard;
  13. outColor = vec4(d.rgb, a);
  14. // outColor = vec4(tex_vs.xy,1.0, 1);
  15. }