2010-09-29 23:29:16 +00:00
|
|
|
varying vec4 waterTex1;
|
|
|
|
varying vec4 waterTex2;
|
|
|
|
varying vec4 waterTex4;
|
2009-08-08 10:17:58 +00:00
|
|
|
varying vec4 ecPosition;
|
2010-09-29 23:29:16 +00:00
|
|
|
uniform float osg_SimulationTime;
|
|
|
|
varying vec3 viewerdir;
|
|
|
|
varying vec3 lightdir;
|
|
|
|
varying vec3 normal;
|
2009-08-08 10:17:58 +00:00
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
2010-09-29 23:29:16 +00:00
|
|
|
vec3 N = normalize(gl_Normal);
|
|
|
|
normal = N;
|
|
|
|
|
|
|
|
ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
|
|
|
|
|
|
|
viewerdir = vec3(gl_ModelViewMatrixInverse[3]) - vec3(gl_Vertex);
|
|
|
|
lightdir = normalize(vec3(gl_ModelViewMatrixInverse * gl_LightSource[0].position));
|
|
|
|
|
2010-10-03 07:15:33 +00:00
|
|
|
waterTex4 = vec4( ecPosition.xzy, 0.0 );
|
2010-09-29 23:29:16 +00:00
|
|
|
|
|
|
|
vec4 t1 = vec4(0.0, osg_SimulationTime*0.005217, 0.0,0.0);
|
|
|
|
vec4 t2 = vec4(0.0, osg_SimulationTime*-0.0012, 0.0,0.0);
|
|
|
|
|
|
|
|
waterTex1 = gl_MultiTexCoord0 + t1;
|
|
|
|
waterTex2 = gl_MultiTexCoord0 + t2;
|
|
|
|
|
|
|
|
gl_Position = ftransform();
|
|
|
|
}
|