diff options
Diffstat (limited to 'indra/newview/app_settings')
4 files changed, 21 insertions, 4 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index fb73ddf219..d057323e51 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1392,6 +1392,18 @@ <real>0.5</real> </map> + <key>CameraMaxCoF</key> + <map> + <key>Comment</key> + <string>Maximum camera circle of confusion for DoF effect</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>10.0</real> + </map> + <key>CameraFNumber</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 81f00f7d0f..56fa4e693b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl @@ -39,6 +39,7 @@ uniform float focal_distance; uniform float blur_constant; uniform float tan_pixel_angle; uniform float magnification; +uniform float max_cof; uniform mat4 inv_proj; uniform vec2 screen_res; @@ -78,7 +79,7 @@ void main() vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy); float sc = calc_cof(depth); - sc = min(abs(sc), 10.0); + sc = min(abs(sc), max_cof); vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res); gl_FragColor.rgb = diff.rgb + bloom.rgb; diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl index de0c70cfe9..c639f25fc6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl @@ -35,6 +35,8 @@ uniform sampler2DRect lightMap; uniform mat4 inv_proj; uniform vec2 screen_res; +uniform float max_cof; + VARYING vec2 vary_fragcoord; void main() @@ -45,5 +47,6 @@ void main() vec4 diff = texture2DRect(lightMap, vary_fragcoord.xy); - gl_FragColor = mix(diff, dof, diff.a); + float a = min(diff.a * max_cof*0.125, 1.0); + 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 1db638b943..629648ddc3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl @@ -33,6 +33,7 @@ uniform sampler2DRect diffuseRect; uniform mat4 inv_proj; uniform vec2 screen_res; +uniform float max_cof; VARYING vec2 vary_fragcoord; @@ -40,7 +41,7 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, vec2 tc) { vec4 s = texture2DRect(diffuseRect, tc); - float sc = s.a*10.0; + float sc = s.a*max_cof; if (sc > min_sc) //sampled pixel is more "out of focus" than current sample radius { @@ -64,7 +65,7 @@ void main() { float w = 1.0; - float sc = diff.a*10.0; + float sc = diff.a*max_cof; float PI = 3.14159265358979323846264; |