Anyways I got a quad to blend two textures. The first one is the water texture, the second is the reflection and nothing really special is happening. I do want to expand on this of course and get a pretty good looking basic water shader.
For my first question; Whats the best way to get a simple reflection using a 2D texture? I want to achieve a very simple reflection of the sky just by using one image, but I'm not sure whats the best for the job without using a 3D cubemap texture.
Second question; How can I 'move' a texture around in GLSL? So I can get the water texture to move around to seem like it's real water.
Third question; How can I figure out how to change the color of the ocean using the water texture and a vec4 including the reflection in one fragment shader?
Thank you for reading and I hope to learn something new from the community!
Encase if your wondering what my fragment shader looks like:
Fragment
uniform sampler2D waveTextureId;
uniform sampler2D waveTextureIdRef;
uniform float waveTime;
void main()
{
vec4 color1 = texture2D(waveTextureId, vec2(gl_TexCoord[0]));
vec4 color2 = texture2D(waveTextureIdRef, vec2(gl_TexCoord[1]));
gl_FragColor = 0.6 * vec4(color1 + color2);
}
Vertex
uniform float waveTime;
void main(void)
{
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1] = gl_MultiTexCoord1;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
Thanks, ajm