summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorTofu Buzzard <no-email>2011-01-16 13:36:44 +0000
committerTofu Buzzard <no-email>2011-01-16 13:36:44 +0000
commit4f06f3dae6d35b142f57e07c41e0a8abcd296fcb (patch)
tree87ac3066b7c7879c274dae3a1269d8b81cb21ec1 /indra/newview
parenta6e8026de00248bf6be5cf608bea6c7d94c4e07c (diff)
FIX VWR-24509 Fix SSAO speckling artifacts at distance, re-enable distant SSAO
(transplanted from ef938dea0504b12fcf802f38fcf5457ba566c468)
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index ad4d700b99..6859f72a9c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -51,6 +51,9 @@ void main()
vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free'
vec4 col = defined_weight.xyxx * ccol;
+ // relax tolerance according to distance to avoid speckling artifacts, as angles and distances are a lot more abrupt within a small screen area at larger distances
+ float pointplanedist_tolerance_pow2 = pos.z*pos.z*0.00005;
+
// perturb sampling origin slightly in screen-space to hide edge-ghosting artifacts where smoothing radius is quite large
tc += ( (int(tc.x+tc.y)%2 - 0.5) * kern[1].z * dlt * 0.5 );
@@ -59,7 +62,7 @@ void main()
vec2 samptc = tc + kern[i].z*dlt;
vec3 samppos = getPosition(samptc).xyz;
float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane
- if (d*d <= 0.003)
+ if (d*d <= pointplanedist_tolerance_pow2)
{
col += texture2DRect(lightMap, samptc)*kern[i].xyxx;
defined_weight += kern[i].xy;
@@ -70,7 +73,7 @@ void main()
vec2 samptc = tc - kern[i].z*dlt;
vec3 samppos = getPosition(samptc).xyz;
float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane
- if (d*d <= 0.003)
+ if (d*d <= pointplanedist_tolerance_pow2)
{
col += texture2DRect(lightMap, samptc)*kern[i].xyxx;
defined_weight += kern[i].xy;