diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-07-24 18:54:09 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-07-24 20:24:50 +0300 |
commit | b1c49b3b2a429a27e8a82e4ed8034a01583333c8 (patch) | |
tree | 0085bdaafdd1b6903c745c40a5e0abf62435169c /source/blender/draw/engines/eevee_next/eevee_instance.hh | |
parent | a5bcb4c1484860844ed3dbbfe0c6bfb47c2427a0 (diff) |
EEVEE-Next: Fix depth accumulation and stability in viewport
The display depth is used to composite Gpencil and Overlays. For it to
be stable we bias it using the dFdx gradient functions. This makes
overlays like edit mode not flicker.
The previous approach to save the 1st center sample does not work anymore
since we jitter the projection matrix in a looping pattern when scene
is updated. So the center depth is only (almost) valid 1/8th of the times.
The biasing technique, even if not perfect, does the job of being stable.
This has a few cons:
- it makes the geometry below the ground plane unlike workbench engine.
- it makes overlays render over geometry at larger depth discontinuities.
Diffstat (limited to 'source/blender/draw/engines/eevee_next/eevee_instance.hh')
-rw-r--r-- | source/blender/draw/engines/eevee_next/eevee_instance.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_instance.hh b/source/blender/draw/engines/eevee_next/eevee_instance.hh index f47d4f20363..1efda769648 100644 --- a/source/blender/draw/engines/eevee_next/eevee_instance.hh +++ b/source/blender/draw/engines/eevee_next/eevee_instance.hh @@ -111,7 +111,7 @@ class Instance { bool overlays_enabled() const { - return (!v3d) || ((v3d->flag & V3D_HIDE_OVERLAYS) == 0); + return v3d && ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0); } bool use_scene_lights() const |