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/gpencil | |
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/gpencil')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_engine.c | 2 | ||||
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_render.c | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 23c53977445..79724f6a5d2 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -559,7 +559,7 @@ static void gpencil_add_draw_data(void *vedata, Object *ob) void GPENCIL_cache_populate(void *vedata, Object *ob) { /* object must be visible */ - if (!DRW_object_is_visible_in_active_context(ob)) { + if (!(DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF)) { return; } diff --git a/source/blender/draw/engines/gpencil/gpencil_render.c b/source/blender/draw/engines/gpencil/gpencil_render.c index 51a8209fbf2..1fe008e4d44 100644 --- a/source/blender/draw/engines/gpencil/gpencil_render.c +++ b/source/blender/draw/engines/gpencil/gpencil_render.c @@ -28,6 +28,7 @@ #include "DRW_render.h" #include "BKE_camera.h" +#include "BKE_object.h" #include "DNA_gpencil_types.h" @@ -130,12 +131,10 @@ static void GPENCIL_render_cache( void *vedata, struct Object *ob, struct RenderEngine *UNUSED(engine), struct Depsgraph *UNUSED(depsgraph)) { - if ((ob == NULL) || (DRW_object_is_visible_in_active_context(ob) == false)) { - return; - } - - if (ob->type == OB_GPENCIL) { - GPENCIL_cache_populate(vedata, ob); + if (ob && ob->type == OB_GPENCIL) { + if (DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF) { + GPENCIL_cache_populate(vedata, ob); + } } } |