Optimisation and tidying
Signed-off-by: Vivian Meazza <vivian.meazza@lineone.net>
This commit is contained in:
parent
15af3ae0a9
commit
f0d21c1f60
4 changed files with 7 additions and 35 deletions
|
@ -24,8 +24,6 @@ uniform int Status;
|
|||
|
||||
varying vec4 waterTex1; //moving texcoords
|
||||
varying vec4 waterTex2; //moving texcoords
|
||||
//varying vec4 waterTex4; //viewts
|
||||
//varying vec4 ecPosition;
|
||||
varying vec3 viewerdir;
|
||||
varying vec3 lightdir;
|
||||
varying vec3 normal;
|
||||
|
@ -147,10 +145,10 @@ void main(void)
|
|||
vNorm = -vNorm;
|
||||
|
||||
//load reflection
|
||||
vec4 tmp = vec4(lightdir, 0.0);
|
||||
vec4 refTex = texture2D(water_reflection, vec2(tmp)) ;
|
||||
vec4 refTexGrey = texture2D(water_reflection_grey, vec2(tmp)) ;
|
||||
vec4 refl ;
|
||||
vec4 tmp = vec4(lightdir, 0.0);
|
||||
vec4 refTex = texture2D(water_reflection, vec2(tmp + waterTex1) * 32.0) ;
|
||||
vec4 refTexGrey = texture2D(water_reflection_grey, vec2(tmp + waterTex1) * 32.0) ;
|
||||
vec4 refl ;
|
||||
// cover = 0;
|
||||
|
||||
if(cover >= 1.5){
|
||||
|
@ -185,16 +183,6 @@ void main(void)
|
|||
refl *= fres;
|
||||
|
||||
vec4 alpha0 = texture2D(alpha_tex, gl_TexCoord[0].st);
|
||||
//refl.a *= alpha0.a;
|
||||
|
||||
////calculate the fog factor
|
||||
//float fogFactor;
|
||||
//float fogCoord = ecPosition.z;
|
||||
//const float LOG2 = 1.442695;
|
||||
//fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||
|
||||
//if(gl_Fog.density == 1.0)
|
||||
// fogFactor=1.0;
|
||||
|
||||
//calculate final colour
|
||||
vec4 ambient_light = gl_LightSource[0].diffuse;
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
|
||||
varying vec4 waterTex1;
|
||||
varying vec4 waterTex2;
|
||||
//varying vec4 waterTex4;
|
||||
//varying vec4 ecPosition;
|
||||
varying vec3 viewerdir;
|
||||
varying vec3 lightdir;
|
||||
varying vec3 normal;
|
||||
|
@ -21,10 +19,6 @@ varying vec3 normal;
|
|||
uniform float osg_SimulationTime;
|
||||
uniform float WindE, WindN, spd, hdg;
|
||||
|
||||
////fog "include"////////
|
||||
// uniform int fogType;
|
||||
//
|
||||
// void fog_Func(int type);
|
||||
/////////////////////////
|
||||
|
||||
|
||||
|
@ -58,13 +52,9 @@ void main(void)
|
|||
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));
|
||||
|
||||
// waterTex4 = vec4( ecPosition.xzy, 0.0 );
|
||||
|
||||
vec4 t1 = vec4(osg_SimulationTime*0.005217, 0.0, 0.0, 0.0);
|
||||
vec4 t2 = vec4(osg_SimulationTime*-0.0012, 0.0, 0.0, 0.0);
|
||||
|
||||
|
@ -77,5 +67,4 @@ void main(void)
|
|||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_Position = ftransform();
|
||||
|
||||
// fog_Func(fogType);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
varying vec4 waterTex1;
|
||||
varying vec4 waterTex2;
|
||||
//varying vec4 waterTex4;
|
||||
|
||||
varying vec3 viewerdir;
|
||||
varying vec3 lightdir;
|
||||
|
@ -34,13 +33,9 @@ void main(void)
|
|||
vec3 N = normalize(gl_Normal);
|
||||
normal = N;
|
||||
|
||||
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
|
||||
viewerdir = vec3(gl_ModelViewMatrixInverse[3]) - vec3(gl_Vertex);
|
||||
lightdir = normalize(vec3(gl_ModelViewMatrixInverse * gl_LightSource[0].position));
|
||||
|
||||
//waterTex4 = vec4(ecPosition.xzy, 0.0 );
|
||||
|
||||
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);
|
||||
|
||||
|
|
|
@ -283,8 +283,8 @@ void main(void)
|
|||
|
||||
//load reflection
|
||||
vec4 tmp = vec4(lightdir, 0.0);
|
||||
vec4 refTex = texture2D(water_reflection, vec2(tmp + waterTex1) * 32.0) ;
|
||||
vec4 refTexGrey = texture2D(water_reflection_grey, vec2(tmp * waterTex1)) ;
|
||||
vec4 refTex = texture2D(water_reflection, vec2(tmp + waterTex1) * 32.0) ;
|
||||
vec4 refTexGrey = texture2D(water_reflection_grey, vec2(tmp + waterTex1) * 32.0) ;
|
||||
vec4 refl ;
|
||||
|
||||
// Test data
|
||||
|
|
Loading…
Reference in a new issue