Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_path_volume.h
| Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | # endif | ||||
| { | { | ||||
| float terminate = path_state_rng_light_termination(kg, rng, state); | float terminate = path_state_rng_light_termination(kg, rng, state); | ||||
| if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { | if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { | ||||
| /* trace shadow ray */ | /* trace shadow ray */ | ||||
| float3 shadow; | float3 shadow; | ||||
| if(!shadow_blocked(kg, emission_sd, state, &light_ray, &shadow)) { | if(!shadow_blocked(kg, emission_sd, state, &light_ray, &shadow)) { | ||||
| /* accumulate */ | /* accumulate */ | ||||
| path_radiance_accum_light(L, throughput, &L_light, shadow, 1.0f, state->bounce, is_lamp); | path_radiance_accum_light(L, state, throughput, &L_light, shadow, 1.0f, is_lamp); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| #endif /* __EMISSION__ */ | #endif /* __EMISSION__ */ | ||||
| } | } | ||||
| #ifdef __KERNEL_GPU__ | #ifdef __KERNEL_GPU__ | ||||
| ccl_device_noinline | ccl_device_noinline | ||||
| ▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | for(int i = 0; i < kernel_data.integrator.num_all_lights; i++) { | ||||
| float terminate = path_branched_rng_light_termination(kg, rng, state, j, num_samples); | float terminate = path_branched_rng_light_termination(kg, rng, state, j, num_samples); | ||||
| if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { | if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { | ||||
| /* trace shadow ray */ | /* trace shadow ray */ | ||||
| float3 shadow; | float3 shadow; | ||||
| if(!shadow_blocked(kg, emission_sd, state, &light_ray, &shadow)) { | if(!shadow_blocked(kg, emission_sd, state, &light_ray, &shadow)) { | ||||
| /* accumulate */ | /* accumulate */ | ||||
| path_radiance_accum_light(L, tp*num_samples_inv, &L_light, shadow, num_samples_inv, state->bounce, is_lamp); | path_radiance_accum_light(L, state, tp*num_samples_inv, &L_light, shadow, num_samples_inv, is_lamp); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* mesh light sampling */ | /* mesh light sampling */ | ||||
| if(kernel_data.integrator.pdf_triangles != 0.0f) { | if(kernel_data.integrator.pdf_triangles != 0.0f) { | ||||
| Show All 32 Lines | if(kernel_data.integrator.pdf_triangles != 0.0f) { | ||||
| float terminate = path_branched_rng_light_termination(kg, rng, state, j, num_samples); | float terminate = path_branched_rng_light_termination(kg, rng, state, j, num_samples); | ||||
| if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { | if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { | ||||
| /* trace shadow ray */ | /* trace shadow ray */ | ||||
| float3 shadow; | float3 shadow; | ||||
| if(!shadow_blocked(kg, emission_sd, state, &light_ray, &shadow)) { | if(!shadow_blocked(kg, emission_sd, state, &light_ray, &shadow)) { | ||||
| /* accumulate */ | /* accumulate */ | ||||
| path_radiance_accum_light(L, tp*num_samples_inv, &L_light, shadow, num_samples_inv, state->bounce, is_lamp); | path_radiance_accum_light(L, state, tp*num_samples_inv, &L_light, shadow, num_samples_inv, is_lamp); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| /* sample random position on random light */ | /* sample random position on random light */ | ||||
| Show All 21 Lines | if(light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, state->bounce, &ls)) { | ||||
| /* sample random light */ | /* sample random light */ | ||||
| float terminate = path_state_rng_light_termination(kg, rng, state); | float terminate = path_state_rng_light_termination(kg, rng, state); | ||||
| if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { | if(direct_emission(kg, sd, emission_sd, &ls, state, &light_ray, &L_light, &is_lamp, terminate)) { | ||||
| /* trace shadow ray */ | /* trace shadow ray */ | ||||
| float3 shadow; | float3 shadow; | ||||
| if(!shadow_blocked(kg, emission_sd, state, &light_ray, &shadow)) { | if(!shadow_blocked(kg, emission_sd, state, &light_ray, &shadow)) { | ||||
| /* accumulate */ | /* accumulate */ | ||||
| path_radiance_accum_light(L, tp, &L_light, shadow, 1.0f, state->bounce, is_lamp); | path_radiance_accum_light(L, state, tp, &L_light, shadow, 1.0f, is_lamp); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| #endif /* __EMISSION__ */ | #endif /* __EMISSION__ */ | ||||
| } | } | ||||
| #endif /* __SPLIT_KERNEL__ */ | #endif /* __SPLIT_KERNEL__ */ | ||||
| #endif /* __VOLUME_SCATTER__ */ | #endif /* __VOLUME_SCATTER__ */ | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||