Cycles: Avoid intermediate function when we sample all lamps.
This commit is contained in:
@@ -546,11 +546,6 @@ ccl_device int light_select_num_samples(KernelGlobals *kg, int index)
|
|||||||
return __float_as_int(data3.x);
|
return __float_as_int(data3.x);
|
||||||
}
|
}
|
||||||
|
|
||||||
ccl_device void light_select(KernelGlobals *kg, int index, float randu, float randv, float3 P, LightSample *ls)
|
|
||||||
{
|
|
||||||
lamp_light_sample(kg, index, randu, randv, P, ls);
|
|
||||||
}
|
|
||||||
|
|
||||||
ccl_device int lamp_light_eval_sample(KernelGlobals *kg, float randt)
|
ccl_device int lamp_light_eval_sample(KernelGlobals *kg, float randt)
|
||||||
{
|
{
|
||||||
/* sample index */
|
/* sample index */
|
||||||
|
@@ -50,7 +50,7 @@ ccl_device void kernel_branched_path_surface_connect_light(KernelGlobals *kg, RN
|
|||||||
path_branched_rng_2D(kg, &lamp_rng, state, j, num_samples, PRNG_LIGHT_U, &light_u, &light_v);
|
path_branched_rng_2D(kg, &lamp_rng, state, j, num_samples, PRNG_LIGHT_U, &light_u, &light_v);
|
||||||
|
|
||||||
LightSample ls;
|
LightSample ls;
|
||||||
light_select(kg, i, light_u, light_v, sd->P, &ls);
|
lamp_light_sample(kg, i, light_u, light_v, sd->P, &ls);
|
||||||
|
|
||||||
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 */
|
||||||
|
@@ -134,7 +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);
|
path_branched_rng_2D(kg, &lamp_rng, state, j, num_samples, PRNG_LIGHT_U, &light_u, &light_v);
|
||||||
|
|
||||||
LightSample ls;
|
LightSample ls;
|
||||||
light_select(kg, i, light_u, light_v, ray->P, &ls);
|
lamp_light_sample(kg, i, light_u, light_v, ray->P, &ls);
|
||||||
|
|
||||||
float3 tp = throughput;
|
float3 tp = throughput;
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ ccl_device void kernel_branched_path_volume_connect_light(KernelGlobals *kg, RNG
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* 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_select(kg, i, light_u, light_v, sd->P, &ls);
|
lamp_light_sample(kg, i, light_u, light_v, sd->P, &ls);
|
||||||
|
|
||||||
if(ls.pdf == 0.0f)
|
if(ls.pdf == 0.0f)
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user