diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-03-16 00:14:42 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-03-16 00:33:02 +0300 |
commit | fe40e184a697c1235a696356b24e8c45dc06185a (patch) | |
tree | 2e07520498c311f700852b816d91468fcb546d93 /source/blender/draw/engines/eevee/shaders | |
parent | efdde88dfc9501764d96cf5b33e2141a86ba44c9 (diff) |
Fix T61857 Eevee DOF not working if the camera is in orthographic mode
It was just a bad mapping of the ogl depth to scene linear depth.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl index 067b0786e34..6aa771bcbd5 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_dof_frag.glsl @@ -29,7 +29,7 @@ uniform vec2 nearFar; /* Near & far view depths values */ #define linear_depth(z) ((ProjectionMatrix[3][3] == 0.0) \ ? (nearFar.x * nearFar.y) / (z * (nearFar.x - nearFar.y) + nearFar.y) \ - : (z * 2.0 - 1.0) * nearFar.y) + : z * (nearFar.y - nearFar.x) + nearFar.x) /* Only true for camera view! */ #define weighted_sum(a, b, c, d, e) (a * e.x + b * e.y + c * e.z + d * e.w) / max(1e-6, dot(e, vec4(1.0))); |