Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_path_volume.h
| Context not available. | |||||
| light_ray.time = sd->time; | light_ray.time = sd->time; | ||||
| #endif | #endif | ||||
| 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(ls.pdf == 0.0f) | if(ls.pdf == 0.0f) | ||||
| return; | return; | ||||
| 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, ray->P, &ls); | light_sample(kg, light_t, light_u, light_v, sd->time, ray->P, &ls, state->bounce); | ||||
| float3 tp = throughput; | float3 tp = throughput; | ||||
| Context not available. | |||||
| kernel_assert(result == VOLUME_PATH_SCATTERED); | kernel_assert(result == VOLUME_PATH_SCATTERED); | ||||
| /* todo: split up light_sample so we don't have to call it again with new position */ | /* todo: split up light_sample so we don't have to call it again with new position */ | ||||
| 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(ls.pdf == 0.0f) | if(ls.pdf == 0.0f) | ||||
| continue; | continue; | ||||
| 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, ray->P, &ls); | light_sample(kg, light_t, light_u, light_v, sd->time, ray->P, &ls, state->bounce); | ||||
| float3 tp = throughput; | float3 tp = throughput; | ||||
| Context not available. | |||||
| kernel_assert(result == VOLUME_PATH_SCATTERED); | kernel_assert(result == VOLUME_PATH_SCATTERED); | ||||
| /* todo: split up light_sample so we don't have to call it again with new position */ | /* todo: split up light_sample so we don't have to call it again with new position */ | ||||
| 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(ls.pdf == 0.0f) | if(ls.pdf == 0.0f) | ||||
| return; | return; | ||||
| Context not available. | |||||