diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-02 14:40:15 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-02 14:40:15 +0100 |
commit | ddc403aec0cf1c78f7206e4706e810b8659627a2 (patch) | |
tree | 2d9054e18f44dfa9440f2e9b9e80fd5abde42444 | |
parent | d8e17c1c31cc8dfb2f78c528eeba227be4a3f1be (diff) |
ssreflections: reflect sunlight direction for reflection. dunno how I feel about this yet.
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 7 |
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); |