Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_path_surface.h
| Context not available. | |||||
| if(sample_all_lights) { | if(sample_all_lights) { | ||||
| /* lamp sampling */ | /* lamp sampling */ | ||||
| for(int i = 0; i < kernel_data.integrator.num_all_lights; i++) { | for(int i = 0; i < kernel_data.integrator.num_all_lights; i++) { | ||||
| if(light_select_reached_max_bounces(kg, i, state->bounce)) | |||||
| continue; | |||||
| int num_samples = ceil_to_int(num_samples_adjust*light_select_num_samples(kg, i)); | int num_samples = ceil_to_int(num_samples_adjust*light_select_num_samples(kg, i)); | ||||
| float num_samples_inv = num_samples_adjust/(num_samples*kernel_data.integrator.num_all_lights); | float num_samples_inv = num_samples_adjust/(num_samples*kernel_data.integrator.num_all_lights); | ||||
| RNG lamp_rng = cmj_hash(*rng, i); | RNG lamp_rng = cmj_hash(*rng, i); | ||||
| Context not available. | |||||
| light_t = 0.5f*light_t; | light_t = 0.5f*light_t; | ||||
| LightSample ls; | LightSample ls; | ||||
| light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls); | light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls, state->bounce); | ||||
| if(direct_emission(kg, sd, &ls, &light_ray, &L_light, &is_lamp, state->bounce, state->transparent_bounce)) { | if(direct_emission(kg, sd, &ls, &light_ray, &L_light, &is_lamp, state->bounce, state->transparent_bounce)) { | ||||
| /* trace shadow ray */ | /* trace shadow ray */ | ||||
| Context not available. | |||||
| path_state_rng_2D(kg, rng, state, PRNG_LIGHT_U, &light_u, &light_v); | path_state_rng_2D(kg, rng, state, PRNG_LIGHT_U, &light_u, &light_v); | ||||
| LightSample ls; | LightSample ls; | ||||
| light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls); | light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls, state->bounce); | ||||
| /* sample random light */ | /* sample random light */ | ||||
| if(direct_emission(kg, sd, &ls, &light_ray, &L_light, &is_lamp, state->bounce, state->transparent_bounce)) { | if(direct_emission(kg, sd, &ls, &light_ray, &L_light, &is_lamp, state->bounce, state->transparent_bounce)) { | ||||
| Context not available. | |||||
| #endif | #endif | ||||
| LightSample ls; | LightSample ls; | ||||
| light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls); | light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls, state->bounce); | ||||
| if(direct_emission(kg, sd, &ls, &light_ray, &L_light, &is_lamp, state->bounce, state->transparent_bounce)) { | if(direct_emission(kg, sd, &ls, &light_ray, &L_light, &is_lamp, state->bounce, state->transparent_bounce)) { | ||||
| /* trace shadow ray */ | /* trace shadow ray */ | ||||
| Context not available. | |||||