summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl18
1 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 8a90199b7c..d6534083cf 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -82,8 +82,7 @@ void main()
discard;
}
- vec3 norm = texture2DRect(normalMap, frag.xy).xyz;
- norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
+ vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0;
norm = normalize(norm);
float l_dist = -dot(lv, proj_n);
@@ -180,6 +179,21 @@ void main()
}
}
+ /*if (spec.a > 0.0)
+ {
+ //vec3 ref = reflect(normalize(pos), norm);
+ float sa = dot(normalize(lv-normalize(pos)),norm);;
+ //sa = max(sa, 0.0);
+ //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0);
+ sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0);
+ sa *= noise;
+ col += da*sa*lcol*spec.rgb;
+ }*/
+
+ //attenuate point light contribution by SSAO component
+ col *= texture2DRect(lightMap, frag.xy).g;
+
+
gl_FragColor.rgb = col;
gl_FragColor.a = 0.0;
}