Fix T40987: Distant Lamps have no influence on Volumes.

Differential Revision: https://developer.blender.org/D639
This commit is contained in:
Thomas Dinges
2014-07-13 12:06:31 +02:00
parent cfbc495b8d
commit e35845d37c
3 changed files with 18 additions and 39 deletions

View File

@@ -41,9 +41,8 @@ ccl_device void kernel_path_volume_connect_light(KernelGlobals *kg, RNG *rng,
light_ray.time = sd->time;
#endif
if(!light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls, true))
return;
else if(ls.pdf == 0.0f)
light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls);
if(ls.pdf == 0.0f)
return;
if(direct_emission(kg, sd, &ls, &light_ray, &L_light, &is_lamp, state->bounce, state->transparent_bounce)) {
@@ -135,8 +134,7 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
path_branched_rng_2D(kg, &lamp_rng, state, j, num_samples, PRNG_LIGHT_U, &light_u, &light_v);
LightSample ls;
if(!light_select(kg, i, light_u, light_v, ray->P, &ls, true))
continue;
light_select(kg, i, light_u, light_v, ray->P, &ls);
float3 tp = throughput;
@@ -152,8 +150,7 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
continue;
/* todo: split up light_sample so we don't have to call it again with new position */
if(!light_select(kg, i, light_u, light_v, sd->P, &ls, true))
continue;
light_select(kg, i, light_u, light_v, sd->P, &ls);
}
if(ls.pdf == 0.0f)
@@ -190,8 +187,7 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
light_t = 0.5f*light_t;
LightSample ls;
if(!light_sample(kg, light_t, light_u, light_v, sd->time, ray->P, &ls, true))
continue;
light_sample(kg, light_t, light_u, light_v, sd->time, ray->P, &ls);
float3 tp = throughput;
@@ -207,8 +203,7 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
continue;
/* todo: split up light_sample so we don't have to call it again with new position */
if(!light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls, true))
continue;
light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls);
}
if(ls.pdf == 0.0f)
@@ -233,8 +228,7 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
path_state_rng_2D(kg, rng, state, PRNG_LIGHT_U, &light_u, &light_v);
LightSample ls;
if(!light_sample(kg, light_t, light_u, light_v, sd->time, ray->P, &ls, true))
return;
light_sample(kg, light_t, light_u, light_v, sd->time, ray->P, &ls);
float3 tp = throughput;
@@ -250,8 +244,7 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
return;
/* todo: split up light_sample so we don't have to call it again with new position */
if(!light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls, true))
return;
light_sample(kg, light_t, light_u, light_v, sd->time, sd->P, &ls);
}
if(ls.pdf == 0.0f)