Fix #114000: EEVEE-Next: Fade/Facing overlays

The fade and facing overlays use a depth equal test. EEVEE next uses
multiple samples to construct the depth and the depth can be different
than the death-center pixel depth.

This PR uses depth-less tests, but in case of the facing overlays it
can produce some artifacts at sharp edges where the normals bleeds.

Other solution would be to render the depth center depth buffer when
one of these overlays are turned on, but that adds overhead as that
will most likely be redrawn for each draw loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/120976
This commit is contained in:
Jeroen Bakker
2024-04-23 14:45:42 +02:00
parent 20a4c9c928
commit ee46030a5a
2 changed files with 2 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ void OVERLAY_facing_cache_init(OVERLAY_Data *vedata)
for (int i = 0; i < 2; i++) {
/* Non Meshes Pass (Camera, empties, lights ...) */
DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_BLEND_ALPHA;
DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND_ALPHA;
DRW_PASS_CREATE(psl->facing_ps[i], state | pd->clipping_state);
GPUShader *sh = OVERLAY_shader_facing();

View File

@@ -23,7 +23,7 @@ void OVERLAY_fade_cache_init(OVERLAY_Data *vedata)
for (int i = 0; i < 2; i++) {
/* Non Meshes Pass (Camera, empties, lights ...) */
DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_BLEND_ALPHA;
DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND_ALPHA;
DRW_PASS_CREATE(psl->fade_ps[i], state | pd->clipping_state);
GPUShader *sh = OVERLAY_shader_uniform_color();