diff options
author | Graham Linden <graham@lindenlab.com> | 2019-03-02 07:17:46 -0800 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-03-02 07:17:46 -0800 |
commit | d8eff424a5fb340b828802351e2b7f6b63bfa30f (patch) | |
tree | 3f314288516fd8a708eda8014247afafb6bdd428 /indra/newview/app_settings/shaders/class1 | |
parent | bf8dee73f90f74f3eb9fd544dc9673defa52817f (diff) |
SL-10664
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/cofF.glsl | 10 |
1 files changed, 6 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 380d382020..079d8458c9 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl @@ -50,8 +50,6 @@ uniform vec2 screen_res; VARYING vec2 vary_fragcoord; -float getDepth(vec2 pos_screen); - float calc_cof(float depth) { float sc = (depth-focal_distance)/-depth*blur_constant; @@ -70,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); |