summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl10
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
index 7325825d6d..66606233cd 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl
@@ -44,7 +44,8 @@ float getDepth(vec2 pos_screen)
void main()
{
- vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz*2.0-1.0;
+ vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz;
+ norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
float depth = getDepth(vary_fragcoord.xy);
vec3 ccol = texture2DRect(giLightMap, vary_fragcoord.xy).rgb;
@@ -56,9 +57,10 @@ void main()
for (int i = 0; i < kern_length; i++)
{
vec2 tc = vary_fragcoord.xy + kern[i].y*dlt;
- vec3 sampNorm = texture2DRect(normalMap, tc.xy).xyz*2.0-1.0;
-
- float d = dot(norm.xyz, sampNorm);
+ vec3 sampNorm = texture2DRect(normalMap, tc.xy).xyz;
+ sampNorm = vec3((sampNorm.xy-0.5)*2.0,sampNorm.z); // unpack norm
+
+ float d = dot(norm.xyz, sampNorm);
if (d > 0.5)
{