diff options
author | Rider Linden <rider@lindenlab.com> | 2019-02-15 00:34:36 +0000 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2019-02-15 00:34:36 +0000 |
commit | f489a8915198b5846c744d3cb2c7ed7447bfe35e (patch) | |
tree | 08b26078c97d928ead26583080d3026baf2c67e5 /indra/newview | |
parent | 43d754b5dee76a47b5b500c6786a7447b61e4bc8 (diff) | |
parent | e3c376d3812f8a2f3868f5baa71fffc785f35911 (diff) |
Merged in graham_linden/viewer-eep-fixes (pull request #278)
SL-10552
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl index d04ac6851a..5cc24475e3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl @@ -81,20 +81,18 @@ float pcfSpotShadow(sampler2DShadow shadowMap, vec4 stc, float bias_scale, vec2 shadow += shadow2D(shadowMap, stc.xyz+vec3(-off.x*2.0, -off.y, 0.0)).x; return shadow*0.2; } - float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen) { float shadow = 0.0f; - vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; + vec3 light_dir = normalize((sun_up_factor == 1) ? sun_dir : moon_dir); - float dp_sun = max(0.0, dot(sun_dir.xyz, norm)); - float dp_moon = max(0.0, dot(moon_dir.xyz, norm)); - float dp_directional_light = (sun_up_factor == 1) ? dp_sun : dp_moon; + float dp_directional_light = max(0.0, dot(norm.xyz, light_dir)); dp_directional_light = clamp(dp_directional_light, 0.0, 1.0); vec3 shadow_pos = pos.xyz; vec3 offset = abs(light_dir.xyz) * (1.0 - dp_directional_light* 0.8); - shadow_pos += offset; + shadow_pos += offset * shadow_offset; + vec4 spos = vec4(shadow_pos.xyz, 1.0); if (spos.z > -shadow_clip.w) |