summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2013-05-07 18:14:29 -0500
committerDave Parks <davep@lindenlab.com>2013-05-07 18:14:29 -0500
commit21ba1e9c1e8afeb1b3cf67462f6e16ff8f6ae91a (patch)
tree21da42d36e4dbfe2463875ec94799691d31691d4 /indra/newview/app_settings/shaders/class1/deferred
parent080981ae8b14b71c5832de11fb968a31a4b5810c (diff)
parentb5ecd3865728e048be8bf394fc8d1a06a317d88f (diff)
Automated merge with https://bitbucket.org/lindenlab/viewer-development-materials
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl14
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index f400eb7a5b..c030c23515 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -64,11 +64,23 @@ vec4 getPosition(vec2 pos_screen)
return pos;
}
+vec3 decode_normal (vec2 enc)
+{
+ vec2 fenc = enc*4-2;
+ float f = dot(fenc,fenc);
+ float g = sqrt(1-f/4);
+ vec3 n;
+ n.xy = fenc*g;
+ n.z = 1-f/2;
+ return n;
+}
+
void main()
{
vec2 tc = vary_fragcoord.xy;
vec3 norm = texture2DRect(normalMap, tc).xyz;
- norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
+ norm = decode_normal(norm.xy); // unpack norm
+
vec3 pos = getPosition(tc).xyz;
vec4 ccol = texture2DRect(lightMap, tc).rgba;