summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-08-09 22:46:47 +0100
committerGraham Linden <graham@lindenlab.com>2018-08-09 22:46:47 +0100
commitfacc678391417c5fa8ca659adc1d449bba2fd349 (patch)
treed41c4613a8bcb23ad6a35cef4c300e13fa23e4d9 /indra/newview/app_settings
parentfb13d9746d8aaf48e27f5eb80254abe17ce66019 (diff)
MAINT-8951
Remove moon_dir related shader code causing sunlight shadow artifacting.
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/skyF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl1
8 files changed, 12 insertions, 42 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 8dda96984e..7f2c5add16 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -43,7 +43,6 @@ uniform mat3 env_mat;
uniform mat3 ssao_effect_mat;
uniform vec3 sun_dir;
-uniform vec3 moon_dir;
#if HAS_SHADOW
uniform sampler2DShadow shadowMap0;
@@ -286,12 +285,9 @@ void main()
calcFragAtmospherics(pos.xyz, 1.0, sunlit, amblit, additive, atten);
vec2 abnormal = encode_normal(norm.xyz);
- norm.xyz = decode_normal(abnormal.xy);
+ norm.xyz = decode_normal(abnormal.xy);
- float da_sun = dot(norm.xyz, sun_dir.xyz);
- float da_moon = dot(norm.xyz, moon_dir.xyz);
-
- float da = max(da_sun, da_moon);
+ float da = dot(norm.xyz, sun_dir.xyz);
float final_da = da;
final_da = min(final_da, shadow);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index 4dc15dbc89..6e06453a5b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -98,7 +98,6 @@ uniform mat3 env_mat;
uniform mat3 ssao_effect_mat;
uniform vec3 sun_dir;
-uniform vec3 moon_dir;
VARYING vec2 vary_fragcoord;
VARYING vec3 vary_position;
@@ -389,9 +388,7 @@ void main()
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
- float da_sun =dot(norm.xyz, sun_dir.xyz);
- float da_moon =dot(norm.xyz, moon_dir.xyz);
- float da = max(da_sun, da_moon);
+ float da =dot(norm.xyz, sun_dir.xyz);
float final_da = da;
final_da = min(final_da, shadow);
@@ -421,9 +418,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*shadow*(texture2D(lightFunc, vec2(sa, spec.a)).r);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index a4543c325e..ec3c0cb68d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -56,7 +56,6 @@ uniform mat3 env_mat;
uniform mat3 ssao_effect_mat;
uniform vec3 sun_dir;
-uniform vec3 moon_dir;
VARYING vec2 vary_fragcoord;
uniform mat4 inv_proj;
@@ -107,9 +106,7 @@ void main()
float envIntensity = norm.z;
norm.xyz = decode_normal(norm.xy); // unpack norm
- float da_sun = dot(norm.xyz, sun_dir.xyz);
- float da_moon = dot(norm.xyz, moon_dir.xyz);
- float da = max(da_sun, da_moon);
+ float da = dot(norm.xyz, sun_dir.xyz);
float final_da = max(0.0,da);
final_da = min(final_da, 1.0f);
@@ -151,9 +148,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*(texture2D(lightFunc, vec2(sa, spec.a)).r);
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);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl
index 43c0505046..47fa0efe06 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl
@@ -34,7 +34,6 @@ in vec3 view_dir;
uniform vec3 cameraPosLocal;
uniform vec3 sun_dir;
-uniform vec3 moon_dir;
uniform float sun_size;
uniform sampler2D transmittance_texture;
diff --git a/indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl b/indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl
index bdb54a1d63..fed3edf7de 100644
--- a/indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl
+++ b/indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl
@@ -33,7 +33,6 @@ in vec3 view_dir;
uniform vec3 cameraPosLocal;
uniform vec3 sun_dir;
-uniform vec3 moon_dir;
uniform float sun_size;
uniform sampler2D transmittance_texture;