From facc678391417c5fa8ca659adc1d449bba2fd349 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 9 Aug 2018 22:46:47 +0100 Subject: MAINT-8951 Remove moon_dir related shader code causing sunlight shadow artifacting. --- .../app_settings/shaders/class2/deferred/softenLightF.glsl | 9 ++------- .../newview/app_settings/shaders/class2/deferred/sunLightF.glsl | 9 ++------- .../app_settings/shaders/class2/deferred/sunLightSSAOF.glsl | 8 ++------ 3 files changed, 6 insertions(+), 20 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 5046ede00d..1e2c49215f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -67,7 +67,6 @@ uniform vec4 shadow_clip; uniform mat3 ssao_effect_mat; uniform vec3 sun_dir; -uniform vec3 moon_dir; VARYING vec2 vary_fragcoord; uniform mat4 inv_proj; @@ -117,9 +116,7 @@ void main() float envIntensity = norm.z; norm.xyz = decode_normal(norm.xy); // unpack norm - float da_sun = max(dot(norm.xyz, sun_dir.xyz), 0.0); - float da_moon = max(dot(norm.xyz, moon_dir.xyz), 0.0); - float da = max(da_sun, da_moon); + float da = max(dot(norm.xyz, sun_dir.xyz), 0.0); float light_gamma = 1.0/1.3; da = pow(da, light_gamma); @@ -170,9 +167,7 @@ void main() // the old infinite-sky shiny reflection // - float sa_sun = dot(refnormpersp, sun_dir.xyz); - float sa_moon = dot(refnormpersp, moon_dir.xyz); - float sa = max(sa_sun, sa_moon); + float sa = dot(refnormpersp, sun_dir.xyz); vec3 dumbshiny = sunlit*scol_ambocc.r*(texture2D(lightFunc, vec2(sa, spec.a)).r); // add the two types of shiny together diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 11ccdf638c..aa5e99a2f7 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -59,7 +59,6 @@ uniform mat4 inv_proj; uniform vec2 screen_res; uniform vec2 proj_shadow_res; uniform vec3 sun_dir; -uniform vec3 moon_dir; uniform vec2 shadow_res; uniform float shadow_bias; @@ -140,14 +139,10 @@ void main() }*/ float shadow = 0.0; - float da_sun = dot(norm, sun_dir.xyz); - float da_moon = dot(norm, moon_dir.xyz); - float da = max(da_sun, da_moon); - - float dp_directional_light = max(0.0, da); + float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz)); vec3 shadow_pos = pos.xyz; - vec3 offset = ((da_sun > da_moon) ? sun_dir.xyz : moon_dir.xyz) * (1.0-dp_directional_light); + vec3 offset = sun_dir.xyz * (1.0-dp_directional_light); vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 4fccb1d33c..58f3f2f91e 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -59,7 +59,6 @@ uniform mat4 inv_proj; uniform vec2 screen_res; uniform vec2 proj_shadow_res; uniform vec3 sun_dir; -uniform vec3 moon_dir; uniform vec2 shadow_res; @@ -201,13 +200,10 @@ void main() }*/ float shadow = 0.0; - float da_sun = dot(norm, sun_dir.xyz); - float da_moon = dot(norm, moon_dir.xyz); - float da = max(da_sun, da_moon); - float dp_directional_light = max(0.0, da); + float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz)); vec3 shadow_pos = pos.xyz; - vec3 offset = ((da_sun > da_moon) ? sun_dir.xyz : moon_dir.xyz) * (1.0-dp_directional_light); + vec3 offset = sun_dir.xyz * (1.0-dp_directional_light); vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); -- cgit v1.2.3