diff options
author | Dave Parks <davep@lindenlab.com> | 2013-05-07 17:11:47 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2013-05-07 17:11:47 -0500 |
commit | b5ecd3865728e048be8bf394fc8d1a06a317d88f (patch) | |
tree | f5025e7585a1292bb1da2b41fa5f288b649300fa /indra/newview/app_settings/shaders/class2 | |
parent | 9609fa72594dd71f8be6417b5a889cfac7112cfd (diff) |
Fix for bad light map generation/sampling.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl | 13 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl | 13 |
2 files changed, 10 insertions, 16 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 1e835ae49e..fa2f415e15 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -136,11 +136,9 @@ void main() vec4 pos = getPosition(pos_screen); - vec4 nmap4 = texture2DRect(normalMap, pos_screen); - nmap4 = vec4(decode_normal(nmap4.xy),nmap4.w); // unpack norm - float displace = nmap4.w; - vec3 norm = nmap4.xyz; - + vec3 norm = texture2DRect(normalMap, pos_screen).xyz; + norm = decode_normal(norm.xy); // unpack norm + /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL { frag_color = vec4(0.0); // doesn't matter @@ -149,9 +147,8 @@ void main() float shadow = 0.0; float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz)); - dp_directional_light = pow(dp_directional_light, 0.7); - - vec3 shadow_pos = pos.xyz + displace*norm; + + vec3 shadow_pos = pos.xyz; 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 a995e9cba1..847fea6c08 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -197,11 +197,9 @@ void main() vec4 pos = getPosition(pos_screen); - vec4 nmap4 = texture2DRect(normalMap, pos_screen); - nmap4 = vec4(decode_normal(nmap4.xy),nmap4.w); // unpack norm - float displace = nmap4.w; - vec3 norm = nmap4.xyz; - + vec3 norm = texture2DRect(normalMap, pos_screen).xyz; + norm = decode_normal(norm.xy); // unpack norm + /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL { frag_color = vec4(0.0); // doesn't matter @@ -210,9 +208,8 @@ void main() float shadow = 0.0; float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz)); - dp_directional_light = pow(dp_directional_light, 0.7); - - vec3 shadow_pos = pos.xyz + displace*norm; + + vec3 shadow_pos = pos.xyz; vec3 offset = sun_dir.xyz * (1.0-dp_directional_light); vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); |