diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-21 14:24:44 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-21 14:24:44 +0100 |
commit | 0cd4106ba6e3d74a9f41dac12fe6e1b504b007f9 (patch) | |
tree | c406c9a6845a38620c4c6c8f0a6a29f998fe64dd | |
parent | f066ff8c607d5c0db8cea8d9cb88eec546df1089 (diff) |
ssreflections: if we're going to (pretend to) take 4 diffuse samples, then take them in a diamond pattern instead of all in a line. this also slightly simplifies(?) the shader.
(transplanted from 7b334c22ece4e98565c5d182690ab9ca4c2526c6)
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 5fb86dd92d..01d18cdcde 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -299,17 +299,14 @@ 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 - vec2 checkoffset = normalize(ref2d)*9.0*(1.0-spec.a)*(checkerboard-0.5); - ref2d += checkoffset; + float checkoffset = 1.0 + (7.0*(1.0-spec.a))*(checkerboard-0.5); + ref2d += vec2(checkoffset, checkoffset); ref2d += tc.xy; // use as offset from destination // 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); + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb + + texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb); float refdepth = texture2DRect(depthMap, ref2d).a; vec3 refpos = getPosition_d(ref2d, refdepth).xyz; vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); |