From 1c892e6814adf7431aa9abbe1bd560547f7144d2 Mon Sep 17 00:00:00 2001 From: Stefan Werner Date: Mon, 17 Aug 2020 16:04:01 +0200 Subject: Cycles: Fix local intersections in Embree for non-instancd geometry. Embree's occlusion filter was checking against the wrong object ID and not exiting correctly in case of a mismatch. Fixes T79723 --- intern/cycles/bvh/bvh_embree.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'intern') diff --git a/intern/cycles/bvh/bvh_embree.cpp b/intern/cycles/bvh/bvh_embree.cpp index 17e1f86a589..4ef873634f0 100644 --- a/intern/cycles/bvh/bvh_embree.cpp +++ b/intern/cycles/bvh/bvh_embree.cpp @@ -126,9 +126,13 @@ static void rtc_filter_occluded_func(const RTCFilterFunctionNArguments *args) } else { kernel_embree_convert_hit(kg, ray, hit, ¤t_isect); - if (ctx->local_object_id != current_isect.object) { + int object = (current_isect.object == OBJECT_NONE) ? + kernel_tex_fetch(__prim_object, current_isect.prim) : + current_isect.object; + if (ctx->local_object_id != object) { /* This tells Embree to continue tracing. */ *args->valid = 0; + break; } } -- cgit v1.2.3 From e157573fab2ad818b20ed869279004ebcf5670f9 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Mon, 17 Aug 2020 14:20:37 +0200 Subject: Fix T77683: Cycles baking crash with motion blur enabled and no camera specified Maniphest Tasks: T77683 Differential Revision: https://developer.blender.org/D8593 --- intern/cycles/blender/blender_object.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'intern') diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 3ea6892a349..e0792962b01 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -458,15 +458,19 @@ void BlenderSync::sync_motion(BL::RenderSettings &b_render, python_thread_state_restore(python_thread_state); b_engine.frame_set(frame, subframe); python_thread_state_save(python_thread_state); - sync_camera_motion(b_render, b_cam, width, height, 0.0f); + if (b_cam) { + sync_camera_motion(b_render, b_cam, width, height, 0.0f); + } sync_objects(b_depsgraph, b_v3d, 0.0f); } /* Insert motion times from camera. Motion times from other objects * have already been added in a sync_objects call. */ - uint camera_motion_steps = object_motion_steps(b_cam, b_cam); - for (size_t step = 0; step < camera_motion_steps; step++) { - motion_times.insert(scene->camera->motion_time(step)); + if (b_cam) { + uint camera_motion_steps = object_motion_steps(b_cam, b_cam); + for (size_t step = 0; step < camera_motion_steps; step++) { + motion_times.insert(scene->camera->motion_time(step)); + } } /* note iteration over motion_times set happens in sorted order */ -- cgit v1.2.3