
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
None | size: 0.53 KB | hits: 17 | expires: Never
// @@ V SHADER
attribute vec4 position;
attribute vec2 textureCoordinates;
uniform mat4 matrix;
varying vec2 fragmentTextureCoordinates;
void main()
{
gl_Position = matrix * position;
fragmentTextureCoordinates = textureCoordinates;
}
// @@ F SHADER
uniform sampler2D texture;
varying mediump vec2 fragmentTextureCoordinates;
uniform float alphaThreshold;
void main()
{
gl_FragColor = texture2D(texture, fragmentTextureCoordinates);
if(gl_FragColor.a<alphaThreshold)
{
discard;
}
}