31 const int shader_flags)
43 else if (!integrator_state_volume_stack_is_empty(kg,
state)) {
66 if (continuation_probability != 1.0f) {
69 if (continuation_probability == 0.0f || terminate >= continuation_probability) {
75 else if (!integrator_state_volume_stack_is_empty(kg,
state)) {
89#ifdef __SHADOW_CATCHER__
125# ifdef __PATH_GUIDING__
138 if (!integrator_state_volume_stack_is_empty(kg,
state)) {
149 const bool use_caustics =
kernel_data.integrator.use_caustics &&
156 else if (use_raytrace_kernel) {
166template<DeviceKernel current_kernel>
178 const bool use_caustics =
kernel_data.integrator.use_caustics &&
186 else if (use_raytrace_kernel) {
197template<DeviceKernel current_kernel>
203 if (!integrator_state_volume_stack_is_empty(kg,
state)) {
212 integrator_intersect_next_kernel_after_shadow_catcher_volume<current_kernel>(kg,
state);
220template<DeviceKernel current_kernel>
230 if (!integrator_state_volume_stack_is_empty(kg,
state)) {
263 const bool use_caustics =
kernel_data.integrator.use_caustics &&
270 else if (use_raytrace_kernel) {
279#ifdef __SHADOW_CATCHER__
304template<DeviceKernel current_kernel>
322 const bool use_caustics =
kernel_data.integrator.use_caustics &&
330 else if (use_raytrace_kernel) {
339#ifdef __SHADOW_CATCHER__
371 ray.tmax =
kernel_data.integrator.ao_bounces_distance;
374 const float object_ao_distance =
kernel_data_fetch(objects, last_isect_object).ao_distance;
375 if (object_ao_distance != 0.0f) {
376 ray.tmax = object_ao_distance;
385 ray.self.object = last_isect_object;
386 ray.self.prim = last_isect_prim;
405 bool from_caustic_caster =
false;
406 bool from_caustic_receiver =
false;
416 if (from_caustic_caster && has_receiver_ancestor) {
419 if (from_caustic_receiver) {
431 kg,
state, &ray, &isect, last_isect_prim, last_isect_object, last_type, path_flag) ||
ccl_device_forceinline int intersection_get_shader(KernelGlobals kg, const ccl_private Intersection *ccl_restrict isect)
ccl_device_forceinline int intersection_get_object_flags(KernelGlobals kg, const ccl_private Intersection *ccl_restrict isect)
#define kernel_assert(cond)
#define ccl_device_forceinline
#define ccl_optional_struct_init
#define kernel_data_fetch(name, index)
const ThreadKernelGlobalsCPU * KernelGlobals
#define CCL_NAMESPACE_END
ccl_device_forceinline void integrator_intersect_next_kernel_after_volume(KernelGlobals kg, IntegratorState state, const ccl_private Intersection *ccl_restrict isect, ccl_global float *ccl_restrict render_buffer)
CCL_NAMESPACE_BEGIN ccl_device_forceinline bool integrator_intersect_skip_lights(KernelGlobals kg, IntegratorState state)
ccl_device void integrator_intersect_closest(KernelGlobals kg, IntegratorState state, ccl_global float *ccl_restrict render_buffer)
ccl_device_forceinline bool integrator_intersect_terminate(KernelGlobals kg, IntegratorState state, const int shader_flags)
ccl_device_forceinline void integrator_intersect_next_kernel(KernelGlobals kg, IntegratorState state, const ccl_private Intersection *ccl_restrict isect, ccl_global float *ccl_restrict render_buffer, const bool hit)
ccl_device_intersect bool scene_intersect(KernelGlobals kg, const ccl_private Ray *ray, const uint visibility, ccl_private Intersection *isect)
ccl_gpu_kernel_postfix ccl_global KernelWorkTile const int ccl_global float * render_buffer
ccl_device_forceinline void guiding_record_continuation_probability(KernelGlobals kg, IntegratorState state, const float continuation_probability)
ccl_device bool lights_intersect(KernelGlobals kg, IntegratorState state, const ccl_private Ray *ccl_restrict ray, ccl_private Intersection *ccl_restrict isect, const int last_prim, const int last_object, const int last_type, const uint32_t path_flag)
@ PATH_MNEE_RECEIVER_ANCESTOR
@ PATH_MNEE_CULL_LIGHT_CONNECTION
@ FILTER_CLOSURE_DIRECT_LIGHT
@ SD_HAS_TRANSPARENT_SHADOW
@ PATH_RAY_SHADOW_CATCHER_HIT
@ PATH_RAY_TERMINATE_AFTER_TRANSPARENT
@ PATH_RAY_TERMINATE_AFTER_VOLUME
@ PATH_RAY_SHADOW_CATCHER_PASS
@ PATH_RAY_TERMINATE_IN_NEXT_VOLUME
@ PATH_RAY_SHADOW_CATCHER_BACKGROUND
@ PATH_RAY_TERMINATE_ON_NEXT_SURFACE
@ SD_OBJECT_CAUSTICS_RECEIVER
@ SD_OBJECT_CAUSTICS_CASTER
@ DEVICE_KERNEL_INTEGRATOR_SHADE_LIGHT
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_VOLUME_STACK
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_MNEE
@ DEVICE_KERNEL_INTEGRATOR_SHADE_VOLUME_RAY_MARCHING
@ DEVICE_KERNEL_INTEGRATOR_SHADE_VOLUME
@ DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND
#define PROFILING_INIT(kg, event)
ccl_device_inline float path_state_continuation_probability(KernelGlobals kg, ConstIntegratorState state, const uint32_t path_flag)
ccl_device_inline bool path_state_ao_bounce(KernelGlobals kg, ConstIntegratorState state)
ccl_device_inline float path_state_rng_1D(KernelGlobals kg, const ccl_private RNGState *rng_state, const int dimension)
ccl_device_inline void path_state_rng_load(ConstIntegratorState state, ccl_private RNGState *rng_state)
ccl_device_inline uint path_state_ray_visibility(ConstIntegratorState state)
@ PROFILING_INTERSECT_CLOSEST
CCL_NAMESPACE_BEGIN ccl_device_inline bool kernel_shadow_catcher_is_path_split_bounce(KernelGlobals kg, IntegratorState state, const int object_flag)
#define INTEGRATOR_STATE_WRITE(state, nested_struct, member)
#define INTEGRATOR_STATE(state, nested_struct, member)
IntegratorStateCPU * IntegratorState
ccl_device_forceinline void integrator_path_next_sorted(KernelGlobals, IntegratorState state, const DeviceKernel current_kernel, const DeviceKernel next_kernel, const uint32_t key)
ccl_device_forceinline void integrator_path_init_sorted(KernelGlobals, IntegratorState state, const DeviceKernel next_kernel, const uint32_t key)
ccl_device_forceinline void integrator_path_init(IntegratorState state, const DeviceKernel next_kernel)
ccl_device_forceinline void integrator_path_next(IntegratorState state, const DeviceKernel current_kernel, const DeviceKernel next_kernel)
ccl_device_forceinline void integrator_path_terminate(KernelGlobals kg, IntegratorState state, ccl_global float *ccl_restrict render_buffer, const DeviceKernel current_kernel)
ccl_device_forceinline void integrator_state_read_ray(ConstIntegratorState state, ccl_private Ray *ccl_restrict ray)
ccl_device_inline IntegratorState integrator_state_shadow_catcher_split(KernelGlobals kg, IntegratorState state)
ccl_device_forceinline void integrator_state_read_isect(ConstIntegratorState state, ccl_private Intersection *ccl_restrict isect)
ccl_device_forceinline void integrator_state_write_isect(IntegratorState state, const ccl_private Intersection *ccl_restrict isect)