summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-07 10:31:56 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-07 10:31:56 +0100
commite07937ced233513bcae55b2365f9ba5a15108faa (patch)
tree4de511ef92ec6282d3f9195cff07cd826d4b184c /indra
parent9454398cd93f1b9710ef027206180a605c374dbd (diff)
apply latest ssreflections tweaks to class2 and class3.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl13
2 files changed, 20 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 00a6a9dcb5..dbccb7fb8b 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -298,12 +298,19 @@ void main()
// 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);
+ 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
+ // Get attributes from the 2D guess point.
+ // We average two samples of diffuse (not of anything else) per
+ // pixel to try to reduce aliasing some more.
+ // ---------------------
+ // ^ ^ ^ ^ ^
+ // a . b o c . d check=0:avg(a,b) check=1:avg(c,d)
+ vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb +
+ texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb);
float refdepth = texture2DRect(depthMap, ref2d).a;
vec3 refpos = getPosition_d(ref2d, refdepth).xyz;
- vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb;
float refshad = texture2DRect(lightMap, ref2d).r;
vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0);
// figure out how appropriate our guess actually was
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index aaa74eb7df..ef81ed1308 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -301,12 +301,19 @@ void main()
// 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);
+ 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
+ // Get attributes from the 2D guess point.
+ // We average two samples of diffuse (not of anything else) per
+ // pixel to try to reduce aliasing some more.
+ // ---------------------
+ // ^ ^ ^ ^ ^
+ // a . b o c . d check=0:avg(a,b) check=1:avg(c,d)
+ vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb +
+ texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb);
float refdepth = texture2DRect(depthMap, ref2d).a;
vec3 refpos = getPosition_d(ref2d, refdepth).xyz;
- vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb;
float refshad = texture2DRect(lightMap, ref2d).r;
vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0);
// figure out how appropriate our guess actually was