summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-12-03 17:37:00 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-12-03 17:37:00 -0500
commit32db8988ffab8778de106dc769228089bec8aad1 (patch)
treec29018f2067dd514e50ed59456a20bec41628c89 /indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
parent46a2bbf8dad21364e8f4842d8b6426fbae543167 (diff)
parent8e7632552b8541a37cca6ae623140d70f74deaac (diff)
merge
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl14
1 files changed, 9 insertions, 5 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
index 77e3e41ea4..02712e0a5b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl
@@ -73,12 +73,14 @@ void main()
{ //pixel is behind far focal plane
float w = 1.0;
- float fd = far_focal_distance;
+ float fd = (depth[0]-far_focal_distance)*0.5+far_focal_distance;
float sc = far_focal_distance - depth[0];
- sc /= -far_focal_distance;
+ sc /= near_focal_distance-far_focal_distance;
+
+ sc = sqrt(sc);
sc = min(sc, 8.0);
-
+
while (sc > 1.0)
{
dofSample(diff,w, fd, sc,sc);
@@ -104,8 +106,10 @@ void main()
{ //pixel is in front of near focal plane
//diff.r = 1.0;
float w = 1.0;
- float sc = depth[0] - fd;
- sc = min(-sc/fd*16.0, 8.0);
+ float sc = near_focal_distance-depth[0];
+ sc /= near_focal_distance;
+ sc *= 8.0;
+ sc = min(sc, 8.0);
fd = depth[0];
while (sc > 1.0)