diff options
Diffstat (limited to 'intern/cycles/kernel/integrator/intersect_closest.h')
-rw-r--r-- | intern/cycles/kernel/integrator/intersect_closest.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/intern/cycles/kernel/integrator/intersect_closest.h b/intern/cycles/kernel/integrator/intersect_closest.h index d5a9df9669b..7fb88fc2804 100644 --- a/intern/cycles/kernel/integrator/intersect_closest.h +++ b/intern/cycles/kernel/integrator/intersect_closest.h @@ -159,9 +159,11 @@ ccl_device void integrator_intersect_closest(KernelGlobals kg, IntegratorState s if (path_state_ao_bounce(kg, state)) { ray.t = kernel_data.integrator.ao_bounces_distance; - const float object_ao_distance = kernel_tex_fetch(__objects, last_isect_object).ao_distance; - if (object_ao_distance != 0.0f) { - ray.t = object_ao_distance; + if (last_isect_object != OBJECT_NONE) { + const float object_ao_distance = kernel_tex_fetch(__objects, last_isect_object).ao_distance; + if (object_ao_distance != 0.0f) { + ray.t = object_ao_distance; + } } } |