summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-03-29 11:30:08 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-03-29 11:30:08 +0100
commite889511a0e3569620897f6ecae7727162dda5701 (patch)
tree0376e4f8c1c845e63a9574cb63dff65e0b5f8c9f /indra/newview/app_settings/shaders/class3
parentd5c07e58c23a4c40507e4c033d502e7a5e9656a4 (diff)
ss reflections tweakage:
+ // Offset the guess source a little according to a trivial + // checkerboard dither function and spec.a. + // This is meant to be similar to sampling a blurred version + // of the diffuse map. LOD would be better in that regard. + // The goal of the blur is to soften reflections in surfaces + // with low shinyness, and also to disguise our lameness.
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl8
1 files changed, 8 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index 9ecb0a40ff..70a1c53456 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -293,6 +293,14 @@ void main()
depth -= 0.5; // unbias depth
// first figure out where we'll make our 2D guess from
vec2 ref2d = tc.xy + (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth;
+ // Offset the guess source a little according to a trivial
+ // checkerboard dither function and spec.a.
+ // This is meant to be similar to sampling a blurred version
+ // of the diffuse map. LOD would be better in that regard.
+ // The goal of the blur is to soften reflections in surfaces
+ // with low shinyness, and also to disguise our lameness.
+ float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0
+ ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5);
// get attributes from the 2D guess point
float refdepth = texture2DRect(depthMap, ref2d).a;
vec3 refpos = getPosition_d(ref2d, refdepth).xyz;