summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-11-10 16:12:50 -0600
committerDave Parks <davep@lindenlab.com>2011-11-10 16:12:50 -0600
commitdf546bfba965ec9ec43b7611bb25b5b5ec8f01b5 (patch)
tree11f7cdd4fba6fb79877c6ceaa2cc03dd6794f62e /indra/newview/app_settings/shaders/class1
parent76bd8cee1120ac531d56b9897b135e9c1af1bb16 (diff)
SH-2666 Tweak depth of field optimizations based on resident feedback.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cofF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl19
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl1
3 files changed, 19 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
index 56fa4e693b..88fe3c3dee 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
@@ -83,5 +83,5 @@ void main()
vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
gl_FragColor.rgb = diff.rgb + bloom.rgb;
- gl_FragColor.a = sc/10.f;
+ gl_FragColor.a = sc/max_cof;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
index d2903b545c..21453aefaa 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl
@@ -36,6 +36,7 @@ uniform mat4 inv_proj;
uniform vec2 screen_res;
uniform float max_cof;
+uniform float res_scale;
VARYING vec2 vary_fragcoord;
@@ -43,10 +44,24 @@ void main()
{
vec2 tc = vary_fragcoord.xy;
- vec4 dof = texture2DRect(diffuseRect, vary_fragcoord.xy*0.5);
+ vec4 dof = texture2DRect(diffuseRect, vary_fragcoord.xy*res_scale);
vec4 diff = texture2DRect(lightMap, vary_fragcoord.xy);
- float a = min(diff.a * max_cof*0.333, 1.0);
+ float a = min(diff.a * max_cof*res_scale*res_scale, 1.0);
+
+ if (a > 0.25 && a < 0.75)
+ { //help out the transition a bit
+ float sc = a/res_scale;
+
+ vec4 col;
+ col = texture2DRect(lightMap, vary_fragcoord.xy+vec2(sc,sc));
+ col += texture2DRect(lightMap, vary_fragcoord.xy+vec2(-sc,sc));
+ col += texture2DRect(lightMap, vary_fragcoord.xy+vec2(sc,-sc));
+ col += texture2DRect(lightMap, vary_fragcoord.xy+vec2(-sc,-sc));
+
+ diff = mix(diff, col*0.25, a);
+ }
+
gl_FragColor = mix(diff, dof, a);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 629648ddc3..4603d99c5e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -34,6 +34,7 @@ uniform sampler2DRect diffuseRect;
uniform mat4 inv_proj;
uniform vec2 screen_res;
uniform float max_cof;
+uniform float res_scale;
VARYING vec2 vary_fragcoord;