diff options
author | Dave Parks <davep@lindenlab.com> | 2011-11-04 17:07:40 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-11-04 17:07:40 -0500 |
commit | 367d6212ae9e18c398c25fe9e11646bfc801fd90 (patch) | |
tree | a4f73bd7099a441a8d710bea8b454703e07dbce3 /indra/newview/app_settings/shaders/class1/deferred | |
parent | 785dcfe6d496bd44730b6ba0004614b2c6d04c6a (diff) |
SH-2652 Better DoF combine foo
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
3 files changed, 9 insertions, 4 deletions
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; |