summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-11-16 17:14:28 -0800
committerLeslie Linden <leslie@lindenlab.com>2011-11-16 17:14:28 -0800
commitc79c4f1477cae232a033e33cc1722b4658cf6634 (patch)
treef4de13df32a228af6923dc16e7af4a7543353f59 /indra/newview/app_settings/shaders/class1
parent38853ffdda5eafee6724177d080fd017265044d0 (diff)
SH-1618 FIX
SH-1619 FIX SH-1620 FIX SH-2621 FIX * Got lighting, shadows, and ambient occlusion working on ATI macs. * Re-enabled ambient occlusion on ATI macs. * Re-enabled depth of field on ATI macs. Reviewed by Runitai Linden.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl24
1 files changed, 16 insertions, 8 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index 7d3b546d3e..60d4dae99f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -44,6 +44,11 @@ VARYING vec2 vary_fragcoord;
uniform mat4 inv_proj;
uniform vec2 screen_res;
+vec3 getKern(int i)
+{
+ return kern[i];
+}
+
vec4 getPosition(vec2 pos_screen)
{
float depth = texture2DRect(depthMap, pos_screen.xy).r;
@@ -68,35 +73,38 @@ void main()
vec2 dlt = kern_scale * delta / (1.0+norm.xy*norm.xy);
dlt /= max(-pos.z*dist_factor, 1.0);
- 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'
+ vec2 defined_weight = getKern(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 += ( (mod(tc.x+tc.y,2) - 0.5) * kern[1].z * dlt * 0.5 );
+ float tc_mod = 0.5*(tc.x + tc.y); // mod(tc.x+tc.y,2)
+ tc_mod -= floor(tc_mod);
+ tc_mod *= 2.0;
+ tc += ( (tc_mod - 0.5) * getKern(1).z * dlt * 0.5 );
for (int i = 1; i < 4; i++)
{
- vec2 samptc = tc + kern[i].z*dlt;
+ vec2 samptc = tc + getKern(i).z*dlt;
vec3 samppos = getPosition(samptc).xyz;
float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane
if (d*d <= pointplanedist_tolerance_pow2)
{
- col += texture2DRect(lightMap, samptc)*kern[i].xyxx;
- defined_weight += kern[i].xy;
+ col += texture2DRect(lightMap, samptc)*getKern(i).xyxx;
+ defined_weight += getKern(i).xy;
}
}
for (int i = 1; i < 4; i++)
{
- vec2 samptc = tc - kern[i].z*dlt;
+ vec2 samptc = tc - getKern(i).z*dlt;
vec3 samppos = getPosition(samptc).xyz;
float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane
if (d*d <= pointplanedist_tolerance_pow2)
{
- col += texture2DRect(lightMap, samptc)*kern[i].xyxx;
- defined_weight += kern[i].xy;
+ col += texture2DRect(lightMap, samptc)*getKern(i).xyxx;
+ defined_weight += getKern(i).xy;
}
}