20 # ifndef __KERNEL_CUDA__
26 kernel_path_subsurface_scatter(KernelGlobals *
kg,
37 float bssrdf_u, bssrdf_v;
54 kg, &ss_isect, sd,
state, sc, &lcg_state, bssrdf_u, bssrdf_v,
false);
56 bool need_update_volume_stack =
kernel_data.integrator.use_volumes &&
63 float bssrdf_roughness =
bssrdf->roughness;
66 for (
int hit = 0; hit < num_hits; hit++) {
81 *hit_tp = *throughput;
82 *hit_L_state =
L->state;
88 hit_state->ray_t = 0.0f;
92 if (need_update_volume_stack) {
93 Ray volume_ray = *ray;
97 kernel_volume_stack_update_for_subsurface(
98 kg, emission_sd, &volume_ray, hit_state->volume_stack);
101 ss_indirect->num_rays++;
112 ss_indirect->num_rays = 0;
115 ccl_device void kernel_path_subsurface_setup_indirect(
124 ss_indirect->num_rays--;
129 *
state = ss_indirect->state[ss_indirect->num_rays];
130 *ray = ss_indirect->rays[ss_indirect->num_rays];
131 L->state = ss_indirect->L_state[ss_indirect->num_rays];
132 *throughput = ss_indirect->throughputs[ss_indirect->num_rays];
ccl_device_inline void path_radiance_sum_indirect(PathRadiance *L)
ccl_device_inline void path_radiance_reset_indirect(PathRadiance *L)
#define kernel_assert(cond)
#define ccl_device_inline
#define CCL_NAMESPACE_END
ccl_device bool kernel_path_surface_bounce(KernelGlobals *kg, ShaderData *sd, ccl_addr_space float3 *throughput, ccl_addr_space PathState *state, PathRadianceState *L_state, ccl_addr_space Ray *ray)
CCL_NAMESPACE_BEGIN ccl_device_inline void kernel_path_surface_connect_light(KernelGlobals *kg, ShaderData *sd, ShaderData *emission_sd, float3 throughput, ccl_addr_space PathState *state, PathRadiance *L)
#define PROFILING_INIT(kg, event)
ccl_device_inline void path_state_rng_2D(KernelGlobals *kg, const ccl_addr_space PathState *state, int dimension, float *fx, float *fy)
ccl_device_inline uint lcg_state_init_addrspace(ccl_addr_space PathState *state, uint scramble)
ccl_device_inline const ShaderClosure * shader_bssrdf_pick(ShaderData *sd, ccl_addr_space float3 *throughput, float *randu)
ccl_device_inline int subsurface_scatter_multi_intersect(KernelGlobals *kg, LocalIntersection *ss_isect, ShaderData *sd, ccl_addr_space PathState *state, const ShaderClosure *sc, uint *lcg_state, float bssrdf_u, float bssrdf_v, bool all)
ccl_device_noinline void subsurface_scatter_multi_setup(KernelGlobals *kg, LocalIntersection *ss_isect, int hit, ShaderData *sd, ccl_addr_space PathState *state, ClosureType type, float roughness)
@ PATH_RAY_DIFFUSE_ANCESTOR
@ SD_OBJECT_INTERSECTS_VOLUME
closure color bssrdf(string method, normal N, vector radius, color albedo) BUILTIN
ccl_device_inline float2 normalize_len(const float2 &a, float *t)