diff --git a/Shaders/model-ALS-ultra.frag b/Shaders/model-ALS-ultra.frag index 8173466e3..286e7acb2 100644 --- a/Shaders/model-ALS-ultra.frag +++ b/Shaders/model-ALS-ultra.frag @@ -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; diff --git a/Shaders/road-ALS-ultra.frag b/Shaders/road-ALS-ultra.frag index ebd61bb2f..9255196fd 100644 --- a/Shaders/road-ALS-ultra.frag +++ b/Shaders/road-ALS-ultra.frag @@ -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);