summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-05-09 15:02:10 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-05-09 15:02:10 +0100
commit514186eee31c4bc44e7bc021bb9c526e4138cb07 (patch)
treebaead739f98c7e374c073ff8012c346b5ce4383f /indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
parent6b26a7c330e83860b28ae051ddd4e88078921256 (diff)
Rejig deferred normal-map packing a little, to double its accuracy for free.
(transplanted from bf541483d9074c18c6d4f4bd19caf0de82013cbf)
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index 794c4d2761..7423347346 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -104,8 +104,9 @@ void main()
vec4 pos = getPosition(pos_screen);
vec4 nmap4 = texture2DRect(normalMap, pos_screen);
+ nmap4 = vec4((nmap4.xy-0.5)*2.0,nmap4.z,nmap4.w); // unpack norm
float displace = nmap4.w;
- vec3 norm = nmap4.xyz*2.0-1.0;
+ vec3 norm = nmap4.xyz;
/*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL
{