# Changeset View

Changeset View

# Standalone View

Standalone View

# intern/cycles/kernel/kernel_bake.h

Context not available. | |||||

&ray, | &ray, | ||||

&L_sample, | &L_sample, | ||||

&throughput); | &throughput); | ||||

unsigned int light_linking = object_light_linking(kg, sd->object); | |||||

kernel_path_indirect(kg, | kernel_path_indirect(kg, | ||||

&rng, | &rng, | ||||

&ray, | &ray, | ||||

throughput, | throughput, | ||||

state.num_samples, | state.num_samples, | ||||

&state, | &state, | ||||

&L_sample); | &L_sample, | ||||

light_linking); | |||||

kernel_path_subsurface_accum_indirect(&ss_indirect, &L_sample); | kernel_path_subsurface_accum_indirect(&ss_indirect, &L_sample); | ||||

} | } | ||||

is_sss_sample = true; | is_sss_sample = true; | ||||

Context not available. | |||||

/* sample light and BSDF */ | /* sample light and BSDF */ | ||||

if(!is_sss_sample && (pass_filter & (BAKE_FILTER_DIRECT | BAKE_FILTER_INDIRECT))) { | if(!is_sss_sample && (pass_filter & (BAKE_FILTER_DIRECT | BAKE_FILTER_INDIRECT))) { | ||||

kernel_path_surface_connect_light(kg, &rng, sd, throughput, &state, &L_sample); | unsigned int light_linking = object_light_linking(kg, sd->object); | ||||

unsigned int shadow_linking = object_shadow_linking(kg, sd->object); | |||||

kernel_path_surface_connect_light(kg, &rng, sd, throughput, &state, &L_sample, light_linking, shadow_linking); | |||||

if(kernel_path_surface_bounce(kg, &rng, sd, &throughput, &state, &L_sample, &ray)) { | if(kernel_path_surface_bounce(kg, &rng, sd, &throughput, &state, &L_sample, &ray)) { | ||||

#ifdef __LAMP_MIS__ | #ifdef __LAMP_MIS__ | ||||

state.ray_t = 0.0f; | state.ray_t = 0.0f; | ||||

#endif | #endif | ||||

/* compute indirect light */ | /* compute indirect light */ | ||||

kernel_path_indirect(kg, &rng, &ray, throughput, 1, &state, &L_sample); | kernel_path_indirect(kg, &rng, &ray, throughput, 1, &state, &L_sample, light_linking); | ||||

/* sum and reset indirect light pass variables for the next samples */ | /* sum and reset indirect light pass variables for the next samples */ | ||||

path_radiance_sum_indirect(&L_sample); | path_radiance_sum_indirect(&L_sample); | ||||

Context not available. | |||||

} | } | ||||

#endif | #endif | ||||

unsigned int light_linking = object_light_linking(kg, sd->object); | |||||

/* sample light and BSDF */ | /* sample light and BSDF */ | ||||

if(pass_filter & (BAKE_FILTER_DIRECT | BAKE_FILTER_INDIRECT)) { | if(pass_filter & (BAKE_FILTER_DIRECT | BAKE_FILTER_INDIRECT)) { | ||||

#if defined(__EMISSION__) | #if defined(__EMISSION__) | ||||

/* direct light */ | /* direct light */ | ||||

if(kernel_data.integrator.use_direct_light) { | if(kernel_data.integrator.use_direct_light) { | ||||

int all = kernel_data.integrator.sample_all_lights_direct; | int all = kernel_data.integrator.sample_all_lights_direct; | ||||

unsigned int shadow_linking = object_shadow_linking(kg, sd->object); | |||||

kernel_branched_path_surface_connect_light(kg, &rng, | kernel_branched_path_surface_connect_light(kg, &rng, | ||||

sd, &state, throughput, 1.0f, &L_sample, all); | sd, &state, throughput, 1.0f, &L_sample, all, light_linking, shadow_linking); | ||||

} | } | ||||

#endif | #endif | ||||

/* indirect light */ | /* indirect light */ | ||||

kernel_branched_path_surface_indirect_light(kg, &rng, | kernel_branched_path_surface_indirect_light(kg, &rng, | ||||

sd, throughput, 1.0f, &state, &L_sample); | sd, throughput, 1.0f, &state, &L_sample, light_linking); | ||||

} | } | ||||

} | } | ||||

#endif | #endif | ||||

Context not available. |