shaderTextureMask.frag 297 Bytes
Newer Older
1 2
// ShaderTextureMask::fragmentShaderText

kvanhoey's avatar
kvanhoey committed
3
PRECISION;
4 5 6 7 8 9 10 11 12
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;
13
	FRAG_OUT=texture2D(textureUnit,texCoord)*m;
14
}