24#ifdef __SHADOW_CATCHER__
35 const uint visibility)
59 const int transparent_max_bounce =
kernel_data.integrator.transparent_max_bounce;
62 return max(transparent_max_bounce - transparent_bounce - 1, 0);
65#ifdef __TRANSPARENT_SHADOWS__
66# ifndef __KERNEL_GPU__
67ccl_device int shadow_intersections_compare(
const void *a,
const void *
b)
72 if (isect_a->
t < isect_b->
t) {
75 if (isect_a->
t > isect_b->
t) {
91 for (
int j = 0; j < num_hits - 1; ++j) {
108 qsort(isect_array, num_hits,
sizeof(
Intersection), shadow_intersections_compare);
115 const uint visibility)
121 float throughput = 1.0f;
122 bool opaque_hit = scene_intersect_shadow_all(
123 kg,
state, ray, visibility, max_hits, &num_hits, &throughput);
127 if (throughput != 1.0f) {
132 if (num_hits > max_hits) {
137 const uint num_recorded_hits =
min(num_hits,
140 if (num_recorded_hits > 0) {
141 sort_shadow_intersections(
state, num_recorded_hits);
165#ifdef __TRANSPARENT_SHADOWS__
168 const bool opaque_hit = (
kernel_data.integrator.transparent_shadows) ?
169 integrate_intersect_shadow_transparent(kg,
state, &ray, visibility) :
#define kernel_assert(cond)
#define ccl_device_forceinline
#define ccl_optional_struct_init
#define SHADOW_CATCHER_VISIBILITY_SHIFT(visibility)
#define INTEGRATOR_SHADOW_ISECT_SIZE
const ThreadKernelGlobalsCPU * KernelGlobals
#define ccl_device_inline
#define SHADOW_CATCHER_PATH_VISIBILITY(path_flag, visibility)
#define CCL_NAMESPACE_END
ccl_device_forceinline int integrate_shadow_max_transparent_hits(KernelGlobals kg, ConstIntegratorShadowState state)
ccl_device void integrator_intersect_shadow(KernelGlobals kg, IntegratorShadowState state)
ccl_device bool integrate_intersect_shadow_opaque(KernelGlobals kg, IntegratorShadowState state, const ccl_private Ray *ray, const uint visibility)
CCL_NAMESPACE_BEGIN ccl_device_forceinline uint integrate_intersect_shadow_visibility(KernelGlobals kg, ConstIntegratorShadowState state)
ccl_device_intersect bool scene_intersect_shadow(KernelGlobals kg, const ccl_private Ray *ray, const uint visibility)
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW
#define PROFILING_INIT(kg, event)
@ PROFILING_INTERSECT_SHADOW
IntegratorShadowStateCPU * IntegratorShadowState
#define INTEGRATOR_STATE_WRITE(state, nested_struct, member)
#define INTEGRATOR_STATE(state, nested_struct, member)
const IntegratorShadowStateCPU * ConstIntegratorShadowState
#define INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member)
ccl_device_forceinline void integrator_shadow_path_terminate(KernelGlobals kg, IntegratorShadowState state, const DeviceKernel current_kernel)
ccl_device_forceinline void integrator_shadow_path_next(KernelGlobals kg, IntegratorShadowState state, const DeviceKernel current_kernel, const DeviceKernel next_kernel)
ccl_device_forceinline void integrator_state_read_shadow_ray(ConstIntegratorShadowState state, ccl_private Ray *ccl_restrict ray)
ccl_device_forceinline void integrator_state_write_shadow_isect(IntegratorShadowState state, const ccl_private Intersection *ccl_restrict isect, const int index)
ccl_device_forceinline void integrator_state_read_shadow_ray_self(KernelGlobals kg, ConstIntegratorShadowState state, ccl_private Ray *ccl_restrict ray)
ccl_device_forceinline void integrator_state_read_shadow_isect(ConstIntegratorShadowState state, ccl_private Intersection *ccl_restrict isect, const int index)