summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
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
parent76bd8cee1120ac531d56b9897b135e9c1af1bb16 (diff)
SH-2666 Tweak depth of field optimizations based on resident feedback.
Diffstat (limited to 'indra/newview/app_settings')
-rwxr-xr-xindra/newview/app_settings/settings.xml14
-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
4 files changed, 32 insertions, 4 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index d07efa6a37..aa08b0783e 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8017,7 +8017,19 @@
<key>Value</key>
<integer>0</integer>
</map>
-
+
+ <key>CameraDoFResScale</key>
+ <map>
+ <key>Comment</key>
+ <string>Amount to scale down depth of field resolution. Valid range is 0.25 (quarter res) to 1.0 (full res)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>0.7</real>
+ </map>
+
<key>RenderSpotLightsInNondeferred</key>
<map>
<key>Comment</key>
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;