tymonr icon

sprites.fragment.glsl

tymonr | PRO | 03/04/20 07:38:46 PM UTC | 0 ⭐ | 8371 👁️ | Never ⏰ | []
OpenGL Shading |

0 B

|

None

|

0 👍

/

0 👎

uniform float alphaTest;
 
varying vec4 vColor;
 
// Samplers
varying vec2 vUV;
uniform sampler2D diffuseSampler;
 
void main(void) {
    vec4 color = texture2D(diffuseSampler, vUV);
 
    if (
        (alphaTest > 0.0 && color.a < alphaTest) ||
        (alphaTest < 0.0 && color.a > alphaTest * -1.0)
        )
        discard;
 
    gl_FragColor = color;
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎