diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-12-18 20:18:00 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-12-21 18:05:48 +0300 |
commit | 0edd93effbc1c0adf7aa9c5647ef69845496f669 (patch) | |
tree | 66cf32ac697824226fa8de790b0d70ada5ce42b5 /source/blender/draw/engines/workbench | |
parent | adec52a8a843a5224e1e59a1dfdcff4986d7dc18 (diff) |
Fix inconsistent/broken Cycles object visibility for instances.
Object visibility is now handled by the depsgraph iterator, but this API
was incomplete as it made no distinction for visibility of the object itself,
particles and generated instances.
The depsgraph iterator API now includes information about which part of the
object is visible, and this is used by Cycles to replace the old custom logic.
Cycles and EEVEE visibility should now be consistent, which unfortunately does
means some subtle compatibility breakage for both.
Fixes T58956, T58202, T59284.
Differential Revision: https://developer.blender.org/D4109
Diffstat (limited to 'source/blender/draw/engines/workbench')
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_deferred.c | 6 | ||||
-rw-r--r-- | source/blender/draw/engines/workbench/workbench_forward.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c index c3b469674d3..52caeb6cbf4 100644 --- a/source/blender/draw/engines/workbench/workbench_deferred.c +++ b/source/blender/draw/engines/workbench/workbench_deferred.c @@ -35,6 +35,7 @@ #include "BKE_node.h" #include "BKE_modifier.h" +#include "BKE_object.h" #include "BKE_particle.h" #include "DNA_image_types.h" @@ -808,7 +809,10 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob) return; /* Do not draw solid in this case. */ } - if (!DRW_object_is_visible_in_active_context(ob) || (ob->dt < OB_SOLID)) { + if (!(DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF)) { + return; + } + if (ob->dt < OB_SOLID) { return; } diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c index ca02cc2b5ea..6c955ac1fcb 100644 --- a/source/blender/draw/engines/workbench/workbench_forward.c +++ b/source/blender/draw/engines/workbench/workbench_forward.c @@ -34,6 +34,7 @@ #include "BKE_node.h" #include "BKE_particle.h" #include "BKE_modifier.h" +#include "BKE_object.h" #include "DNA_image_types.h" #include "DNA_mesh_types.h" @@ -489,7 +490,10 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob) return; /* Do not draw solid in this case. */ } - if (!DRW_object_is_visible_in_active_context(ob) || (ob->dt < OB_WIRE)) { + if (!(DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF)) { + return; + } + if (ob->dt < OB_WIRE) { return; } |