23#ifdef __SHADOW_CATCHER__
34 const uint visibility)
58 const int transparent_max_bounce =
kernel_data.integrator.transparent_max_bounce;
61 return max(transparent_max_bounce - transparent_bounce, 0);
64#ifdef __TRANSPARENT_SHADOWS__
65# ifndef __KERNEL_GPU__
66ccl_device int shadow_intersections_compare(
const void *a,
const void *
b)
71 if (isect_a->
t < isect_b->
t) {
74 if (isect_a->
t > isect_b->
t) {
90 for (
int j = 0; j < num_hits - 1; ++j) {
107 qsort(isect_array, num_hits,
sizeof(
Intersection), shadow_intersections_compare);
114 const uint visibility)
120 float throughput = 1.0f;
121 bool opaque_hit = scene_intersect_shadow_all(
122 kg,
state, ray, visibility, max_transparent_hits, &num_hits, &throughput);
126 if (throughput != 1.0f) {
133 if (num_recorded_hits > 0) {
134 sort_shadow_intersections(
state, num_recorded_hits);
158#ifdef __TRANSPARENT_SHADOWS__
161 const bool opaque_hit = (
kernel_data.integrator.transparent_shadows) ?
162 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_NAMESPACE_BEGIN ccl_device_forceinline uint integrate_intersect_shadow_visibility(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_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(IntegratorShadowState state, const DeviceKernel current_kernel)
ccl_device_forceinline void integrator_shadow_path_next(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_isect(ConstIntegratorShadowState state, ccl_private Intersection *ccl_restrict isect, const int index)
ccl_device_forceinline void integrator_state_read_shadow_ray_self(ConstIntegratorShadowState state, ccl_private Ray *ccl_restrict ray)