15#ifdef __SHADOW_CATCHER__
26 const uint visibility)
50 const int transparent_max_bounce =
kernel_data.integrator.transparent_max_bounce;
53 return max(transparent_max_bounce - transparent_bounce - 1, 0);
56#ifdef __TRANSPARENT_SHADOWS__
57# ifndef __KERNEL_GPU__
58ccl_device int shadow_intersections_compare(
const void *a,
const void *
b)
63 if (isect_a->
t < isect_b->
t)
65 else if (isect_a->
t > isect_b->
t)
81 for (
int j = 0; j < num_hits - 1; ++j) {
98 qsort(isect_array, num_hits,
sizeof(
Intersection), shadow_intersections_compare);
105 const uint visibility)
111 float throughput = 1.0f;
112 bool opaque_hit = scene_intersect_shadow_all(
113 kg,
state, ray, visibility, max_hits, &num_hits, &throughput);
117 if (throughput != 1.0f) {
122 if (num_hits > max_hits) {
129 if (num_recorded_hits > 0) {
130 sort_shadow_intersections(
state, num_recorded_hits);
154#ifdef __TRANSPARENT_SHADOWS__
157 const bool opaque_hit = (
kernel_data.integrator.transparent_shadows) ?
158 integrate_intersect_shadow_transparent(kg,
state, &ray, visibility) :
local_group_size(16, 16) .push_constant(Type b
#define kernel_assert(cond)
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define ccl_device_forceinline
#define ccl_optional_struct_init
#define ccl_device_inline
#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_NAMESPACE_BEGIN ccl_device_forceinline uint integrate_intersect_shadow_visibility(KernelGlobals kg, ConstIntegratorShadowState state)
ccl_device bool integrate_intersect_shadow_opaque(KernelGlobals kg, IntegratorShadowState state, ccl_private const Ray *ray, const uint visibility)
ccl_device_intersect bool scene_intersect_shadow(KernelGlobals kg, ccl_private const Ray *ray, const uint visibility)
#define SHADOW_CATCHER_VISIBILITY_SHIFT(visibility)
#define INTEGRATOR_SHADOW_ISECT_SIZE
#define SHADOW_CATCHER_PATH_VISIBILITY(path_flag, visibility)
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW
#define PROFILING_INIT(kg, event)
const IntegratorShadowStateCPU *ccl_restrict ConstIntegratorShadowState
#define INTEGRATOR_STATE_WRITE(state, nested_struct, member)
#define INTEGRATOR_STATE(state, nested_struct, member)
IntegratorShadowStateCPU *ccl_restrict IntegratorShadowState
#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, ccl_private const 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)
@ PROFILING_INTERSECT_SHADOW