1
0
Fork 0

Change to the up vector used in sky irradiance light in ALS shader.

Models that are xml offset with pitch, heading or yaw should now be correct lighted.
This commit is contained in:
Nikolai V. Chr 2017-10-10 17:58:32 +02:00
parent 70277258bf
commit a206b3cb51
2 changed files with 4 additions and 2 deletions

View file

@ -79,6 +79,7 @@ uniform float snowlevel;
uniform float snow_thickness_factor;
uniform float osg_SimulationTime;
uniform mat4 osg_ViewMatrix;
uniform float landing_light1_offset;
uniform float landing_light2_offset;
@ -155,7 +156,7 @@ void main (void)
/// BEGIN geometry for light
vec3 up = (gl_ModelViewMatrix * vec4(0.0,0.0,1.0,0.0)).xyz;
vec3 up = (osg_ViewMatrix * vec4(0.0,0.0,1.0,0.0)).xyz;
//vec4 worldPos3D = (osg_ViewMatrixInverse * vec4 (0.0,0.0,0.0, 1.0));
//worldPos3D.a = 0.0;
//vec3 up = (osg_ViewMatrix * worldPos3D).xyz;

View file

@ -76,6 +76,7 @@ uniform float snowlevel;
uniform float snow_thickness_factor;
uniform float osg_SimulationTime;
uniform mat4 osg_ViewMatrix;
uniform float landing_light1_offset;
uniform float landing_light2_offset;
@ -221,7 +222,7 @@ void main (void)
/// BEGIN geometry for light
vec3 up = (gl_ModelViewMatrix * vec4(0.0,0.0,1.0,0.0)).xyz;
vec3 up = (osg_ViewMatrix * vec4(0.0,0.0,1.0,0.0)).xyz;
vec3 nVertVec = normalize(vertVec);