diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-06-10 21:06:02 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-06-10 21:06:26 +0300 |
commit | 20b0194cd3f33f613bba6923e3ca6fbf16838c55 (patch) | |
tree | f6cb050e41d46d66fc38503902ff82a932d41a9d /source/blender/draw/engines/workbench/workbench_forward.c | |
parent | 542462d35c5c17742aa4d3d17c13bbbf312fe7a3 (diff) |
Workbench: Xray: Make dithered depth dependant on alpha.
The range is 0.25 to 0.75 opacity when the Xray opacity is between 0.0 to 1.0.
This is to avoid loosing completely the sense of occlusion when having no
other solid drawing than the wireframe and loosing the transparency when
xray alpha is at 1.0.
Also replace Bayer (checkerboard) method by interlieved gradient noise to
minimize the chance to loose an occluded line completely.
Other noise function could be tested in the future.
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_forward.c')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_forward.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c index 4e97fc730a3..6864d1ec9b3 100644 --- a/source/blender/draw/engines/workbench/workbench_forward.c +++ b/source/blender/draw/engines/workbench/workbench_forward.c @@ -353,6 +353,7 @@ void workbench_forward_engine_init(WORKBENCH_Data *vedata) 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); } } |