2022-05-18 07:46:03 -04:00
|
|
|
//SpriteBatch will use texture unit 0
|
|
|
|
|
uniform sampler2D u_texture;
|
|
|
|
|
|
|
|
|
|
//"in" varyings from our vertex shader
|
|
|
|
|
varying vec4 vColor;
|
|
|
|
|
varying vec2 vTexCoord;
|
|
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
|
vec4 texColor = texture2D(u_texture, vTexCoord);
|
2022-05-20 04:26:12 -04:00
|
|
|
if(texColor == vec4(1, 0, 1, 1) || texColor == vec4(1, 0, 0, 1) || texColor.w == 0) {
|
|
|
|
|
discard;
|
2022-05-18 07:46:03 -04:00
|
|
|
} else {
|
|
|
|
|
gl_FragColor = texColor * vColor;
|
|
|
|
|
}
|
|
|
|
|
}
|