summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/cofF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cofF.glsl7
1 files changed, 4 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 88fe3c3dee..e612efba61 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
@@ -57,7 +57,7 @@ float getDepth(vec2 pos_screen)
float calc_cof(float depth)
{
- float sc = abs(depth-focal_distance)/-depth*blur_constant;
+ float sc = (depth-focal_distance)/-depth*blur_constant;
sc /= magnification;
@@ -79,9 +79,10 @@ void main()
vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
float sc = calc_cof(depth);
- sc = min(abs(sc), max_cof);
+ sc = min(sc, max_cof);
+ sc = max(sc, -max_cof);
vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
gl_FragColor.rgb = diff.rgb + bloom.rgb;
- gl_FragColor.a = sc/max_cof;
+ gl_FragColor.a = sc/max_cof*0.5+0.5;
}