Advertisement
tymonr

sprites.fragment.glsl

Mar 4th, 2020
1,108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uniform float alphaTest;
  2.  
  3. varying vec4 vColor;
  4.  
  5. // Samplers
  6. varying vec2 vUV;
  7. uniform sampler2D diffuseSampler;
  8.  
  9. void main(void) {
  10.     vec4 color = texture2D(diffuseSampler, vUV);
  11.  
  12.     if (
  13.         (alphaTest > 0.0 && color.a < alphaTest) ||
  14.         (alphaTest < 0.0 && color.a > alphaTest * -1.0)
  15.         )
  16.         discard;
  17.  
  18.     gl_FragColor = color;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement