diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-03-26 17:36:15 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-03-26 17:55:16 +0300 |
commit | e000dcb8490880d6d49aa91588c457612685e9f1 (patch) | |
tree | a1872556d19a2751455ab803cb13d00318ee63b8 /source/blender/draw/engines/overlay/overlay_private.h | |
parent | 458f50ba73bcd233176f9afadc3273acf05e4f53 (diff) |
Overlay: Wireframe: New method to avoid zfighting with geometry
This new method is only enabled if Overlay Smooth Wire is enabled.
This method gives really nice results but has some downside:
- Require a depth copy or loose the ability to write wire depth to the
depth buffer and have correct depth ordering of wires. This patch use the former, with its associated cost.
- Require some depth sampling and prevent early depth test (i.e: has
some performance impact).
- Has some relatively minor instability with geometry that are perpendicular
to the view and intersecting with other geometry.
Pros:
- Compared to a fullpass approach this is surely going to have less
performance impact and much higher quality.
- Removes the additional vertex offset. (see T74961)
- Fixes all half edges z-fighting.
{F8428014}
{F8428015}
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D7233
Diffstat (limited to 'source/blender/draw/engines/overlay/overlay_private.h')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_private.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_private.h b/source/blender/draw/engines/overlay/overlay_private.h index 7cc83c76857..bd9583c6a5f 100644 --- a/source/blender/draw/engines/overlay/overlay_private.h +++ b/source/blender/draw/engines/overlay/overlay_private.h @@ -293,6 +293,8 @@ typedef struct OVERLAY_PrivateData { struct { bool enabled; + bool do_depth_copy; + bool do_depth_infront_copy; } antialiasing; struct { bool show_handles; @@ -411,6 +413,7 @@ void OVERLAY_antialiasing_start(OVERLAY_Data *vedata); void OVERLAY_antialiasing_end(OVERLAY_Data *vedata); void OVERLAY_xray_fade_draw(OVERLAY_Data *vedata); void OVERLAY_xray_depth_copy(OVERLAY_Data *vedata); +void OVERLAY_xray_depth_infront_copy(OVERLAY_Data *vedata); bool OVERLAY_armature_is_pose_mode(Object *ob, const struct DRWContextState *draw_ctx); void OVERLAY_armature_cache_init(OVERLAY_Data *vedata); @@ -613,7 +616,7 @@ GPUShader *OVERLAY_shader_particle_shape(void); GPUShader *OVERLAY_shader_pointcloud_dot(void); GPUShader *OVERLAY_shader_sculpt_mask(void); GPUShader *OVERLAY_shader_volume_velocity(bool use_needle); -GPUShader *OVERLAY_shader_wireframe(void); +GPUShader *OVERLAY_shader_wireframe(bool custom_bias); GPUShader *OVERLAY_shader_wireframe_select(void); GPUShader *OVERLAY_shader_xray_fade(void); |