summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-02 14:40:15 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-02 14:40:15 +0100
commit17f709abcde85fd073bd0ef8b1525cf4a021ccb7 (patch)
tree443cba0e4da73fa28e70612d31925e49dde4510e /indra
parentdda40bd7823b05acb3aeb1729c7451713e084449 (diff)
ssreflections: reflect sunlight direction for reflection. dunno how I feel about this yet.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 155f03fdcf..51d737f10b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -310,8 +310,11 @@ void main()
// darken reflections from points which face away from the reflected ray - our guess was a back-face
//refapprop *= step(dot(refnorm, refn), 0.0);
refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant
- // get appropriate light strength for guess-point
- float reflit = max(dot(refn, lightnorm.xyz), 0.0);
+ // get appropriate light strength for guess-point.
+ // reflect light direction to increase the illusion that
+ // these are reflections.
+ vec3 reflight = reflect(lightnorm.xyz, norm.xyz);
+ float reflit = max(dot(refn, reflight.xyz), 0.0);
// apply sun color to guess-point, dampen according to inappropriateness of guess
vec3 refprod = (vary_SunlitColor*reflit) * refcol.rgb * refapprop;
vec3 ssshiny = (refprod * spec.a);