diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-09-21 15:10:06 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-09-21 16:45:03 +0300 |
commit | 3523958de9f129e260a8a31260ef9459a10cc3cc (patch) | |
tree | 62bf2a9bc2d397c1f75a1847beccf5c444c5fcac /source/blender/draw/engines/workbench/workbench_forward.c | |
parent | 6934b246d186ce612100cf1a540fd23bde171fc8 (diff) |
DRW: Add back wireframe mode
This is using the existing engine (workbench forward) with 0.0 xray_alpha
and forcing wireframes on all objects.
There is no workflow/shortcut changes in this commit.
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_forward.c')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_forward.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c index 2df81314cf4..938852c764e 100644 --- a/source/blender/draw/engines/workbench/workbench_forward.c +++ b/source/blender/draw/engines/workbench/workbench_forward.c @@ -363,11 +363,21 @@ void workbench_forward_engine_init(WORKBENCH_Data *vedata) /* Checker Depth */ { + float blend_threshold = 0.0f; + + if (draw_ctx->v3d->shading.flag & V3D_SHADING_XRAY) { + blend_threshold = 0.75f - wpd->shading.xray_alpha * 0.5f; + } + + if (draw_ctx->v3d->shading.type == OB_WIRE) { + wpd->shading.xray_alpha = 0.0f; + } + int state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_ALWAYS; psl->checker_depth_pass = DRW_pass_create("Checker Depth", state); grp = DRW_shgroup_create(e_data.checker_depth_sh, psl->checker_depth_pass); DRW_shgroup_call_add(grp, DRW_cache_fullscreen_quad_get(), NULL); - DRW_shgroup_uniform_float_copy(grp, "threshold", 0.75f - wpd->shading.xray_alpha * 0.5f); + DRW_shgroup_uniform_float_copy(grp, "threshold", blend_threshold); } } |