Hi, this code:
glGetUniformLocationArb(shader_program, "red");
returns -1.
The "shader_program" is what I passed to glUseProgramObjectArb before.
I don't provide a vertex shader. My fragment shader code seems to be
loaded
and working and is:
(BTW: I don't set the "image" in my main code anywhere, but I can access
the
texture)
# # #
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);
}
}
# # #
--
------------------------------------
Gernot Frisch
http://www.glbasic.com


|