> # # #
> uniform sampler2D image;
> uniform float red, green, blue;
>
> void main()
> {
> vec4 texel = texture2D(image, gl_TexCoord[0].xy).rgba;
>
> if(texel.a > 0.001)
> {
> if(abs(texel.g - texel.r) < 0.0001) // black -> recolor
> {
> gl_FragColor = vec4(red, green, blue, texel.a);
> }
> else // blue eyes
> {
> gl_FragColor = texel;
> }
> }
> else // transparent
> {
> gl_FragColor = vec4(0,0,0.0, 0.0);
> }
> }
Oh dear! The compiler's optimized my uniform variable out. I put a
glFragColor=vec4(1,0,0,1) at the end, just to see if the shader gets
loaded.
Doh!


|