summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-06 22:24:57 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-06 22:24:57 +0100
commit958bbdd4f5d38bb07914f35896edf188b1437355 (patch)
treef410491a46c6bc49b1793ebd73e604e203edbbc5 /indra/newview/app_settings/shaders/class1/deferred
parent286572ec90558015bfec8a7f738502b63465be3e (diff)
extra diffuse sample in ssreflection to decrease aliasing.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl9
1 files changed, 7 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 503c7d0b83..3f4425a0b2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -298,13 +298,18 @@ void main()
// 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.
+ // ---------------------
+ // ^ ^ ^ ^ ^
+ // a . b o c . d check=0:avg(a,b) check=1:avg(c,d)
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);
+ vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5);
+ ref2d += checkoffset;
ref2d += tc.xy; // use as offset from destination
// get attributes from the 2D guess point
float refdepth = texture2DRect(depthMap, ref2d).a;
vec3 refpos = getPosition_d(ref2d, refdepth).xyz;
- vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb;
+ vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb +
+ texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb);
vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0);
// figure out how appropriate our guess actually was
float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos)));