Workbench: Xray: Make dithered depth dependant on alpha.
authorClément Foucault <foucault.clem@gmail.com>
Sun, 10 Jun 2018 18:06:02 +0000 (20:06 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Sun, 10 Jun 2018 18:06:26 +0000 (20:06 +0200)
commit20b0194cd3f33f613bba6923e3ca6fbf16838c55
treef6cb050e41d46d66fc38503902ff82a932d41a9d
parent542462d35c5c17742aa4d3d17c13bbbf312fe7a3
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.
source/blender/draw/engines/workbench/shaders/workbench_checkerboard_depth_frag.glsl
source/blender/draw/engines/workbench/workbench_forward.c