Fix T76168 Workbench: Shadows behind a culled backface are inverted

This commit is contained in:
Clément Foucault 2020-05-14 17:39:18 +02:00
parent 16d8a683be
commit 5940485369
Notes: blender-bot 2023-02-14 06:42:54 +01:00
Referenced by issue #76168, Workbench shadows behind a culled backface are inverted.
1 changed files with 5 additions and 0 deletions

View File

@ -333,6 +333,11 @@ void workbench_shadow_cache_populate(WORKBENCH_Data *data, Object *ob, const boo
use_shadow_pass_technique = false;
}
/* We cannot use Shadow Pass technique on non-manifold object (see T76168). */
if (use_shadow_pass_technique && !is_manifold && (wpd->cull_state != 0)) {
use_shadow_pass_technique = false;
}
if (use_shadow_pass_technique) {
grp = DRW_shgroup_create_sub(wpd->shadow_pass_grp[is_manifold]);
DRW_shgroup_uniform_vec3(grp, "lightDirection", engine_object_data->shadow_dir, 1);