From aa46459543e7ff26ad5d2ba7801ad0a0a0bc99fc Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 13 Oct 2021 15:55:54 +0200 Subject: Fix shadow catcher behind transparent object on GPU The assumption about absent shadow path was wrong. The rest of the changes are to ensure shadow paths are finished prior to the split, so that they write to the proper passes. The issue was caught by running regression tests on OptiX. Differential Revision: https://developer.blender.org/D12857 --- intern/cycles/integrator/path_trace_work_gpu.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'intern/cycles/integrator') diff --git a/intern/cycles/integrator/path_trace_work_gpu.cpp b/intern/cycles/integrator/path_trace_work_gpu.cpp index df393bac0de..02830a00405 100644 --- a/intern/cycles/integrator/path_trace_work_gpu.cpp +++ b/intern/cycles/integrator/path_trace_work_gpu.cpp @@ -342,10 +342,14 @@ bool PathTraceWorkGPU::enqueue_path_iteration() } /* Finish shadows before potentially adding more shadow rays. We can only - * store one shadow ray in the integrator state. */ + * store one shadow ray in the integrator state. + * + * When there is a shadow catcher in the scene finish shadow rays before invoking interesect + * closest kernel since so that the shadow paths are writing to the pre-split state. */ if (kernel == DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE || kernel == DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE || - kernel == DEVICE_KERNEL_INTEGRATOR_SHADE_VOLUME) { + kernel == DEVICE_KERNEL_INTEGRATOR_SHADE_VOLUME || + (has_shadow_catcher() && kernel == DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST)) { if (queue_counter->num_queued[DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW]) { enqueue_path_iteration(DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW); return true; -- cgit v1.2.3