shaderTextureMask.frag 300 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// ShaderTextureMask::fragmentShaderText

PRECISON;
VARYING_FRAG vec2 texCoord;
uniform sampler2D textureUnit;
uniform sampler2D textureUnitMask;
FRAG_OUT_DEF;
void main()
{
	float m = texture2D(textureUnitMask,texCoord).r;
	if (m < 0.5)
		discard;
	gl_FragColor=texture2D(textureUnit,texCoord)*m;
}