summaryrefslogtreecommitdiff
path: root/indra/newview
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
commit89ad33a53ef239adf332532fa1039ae6313f5ba9 (patch)
treed470191937af8ef5a1775a532de947171b71a852 /indra/newview
parent6fbe144e4cf578bb76c4e015c191300c17ac44fe (diff)
ssreflections: reflect sunlight direction for reflection. dunno how I feel about this yet.
Diffstat (limited to 'indra/newview')
-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);