summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-04-20 18:14:37 +0000
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-04-20 18:14:37 +0000
commit9634bcf488f45675e53a761808f59881b57cbe8c (patch)
tree40b695d7acb23e381331bda92c9f7550d655749e /indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
parentde17c53ae32fef76827201ed24a5af137af12313 (diff)
parentd7f1c88c35849e56f5b352f13c16a08467d1533b (diff)
Merged master into DRTVWR-508
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/cofF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cofF.glsl17
1 files changed, 6 insertions, 11 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
index fef1c5a584..079d8458c9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
@@ -50,15 +50,6 @@ uniform vec2 screen_res;
VARYING vec2 vary_fragcoord;
-float getDepth(vec2 pos_screen)
-{
- float z = texture2DRect(depthMap, pos_screen.xy).r;
- z = z*2.0-1.0;
- vec4 ndc = vec4(0.0, 0.0, z, 1.0);
- vec4 p = inv_proj*ndc;
- return p.z/p.w;
-}
-
float calc_cof(float depth)
{
float sc = (depth-focal_distance)/-depth*blur_constant;
@@ -77,8 +68,12 @@ float calc_cof(float depth)
void main()
{
vec2 tc = vary_fragcoord.xy;
-
- float depth = getDepth(tc);
+
+ float z = texture2DRect(depthMap, tc).r;
+ z = z*2.0-1.0;
+ vec4 ndc = vec4(0.0, 0.0, z, 1.0);
+ vec4 p = inv_proj*ndc;
+ float depth = p.z/p.w;
vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);