librw/src/gl/shaders/matfx_env.frag

35 lines
420 B
GLSL
Raw Normal View History

#version 330
layout(std140) uniform State
{
int u_alphaTest;
float u_alphaRef;
// fog etc.
};
uniform sampler2D tex;
in vec4 v_color;
in vec2 v_tex0;
out vec4 color;
void
main(void)
{
2017-08-09 10:57:32 +02:00
color = v_color*texture(tex, vec2(v_tex0.x, v_tex0.y));
switch(u_alphaTest){
default:
case 0: break;
case 1:
if(color.a < u_alphaRef)
discard;
break;
case 2:
if(color.a >= u_alphaRef)
discard;
break;
}
}