Hello everyone.,
I’m giving my first steps in the world of shaders, and i’m having a little problem., i hope someone can give me some light.
I’m tryng to do a shader, to distort a water reflection.
The water reflection is already in a texture, and it’s being projected correctly to the water plane.,
But, somehow when i have automatic coordinates generation enabled in opengl, and i go trough the shader, the shader messes up my coords.
This is the shader :
The vertex program :
varying vec3 texCoord;
void main(void)
{
texCoord = gl_MultiTexCoord0.xyz;
gl_Position = ftransform();
}
and the fragment program
uniform sampler2D Texture0;
varying vec3 texCoord;
void main(void)
{
gl_FragColor = texture2DProj( Texture0, texCoord );
}
I just want the reflected texture to show up, with anything changed, so i can start messing with it later.
thanks for any help,
Bruno