diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-06-07 03:27:38 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-06-07 03:27:38 +0400 |
commit | 5ebc88266e71249e664e994e081627c926faf89e (patch) | |
tree | 8842dd530ead055ce8d3d33f90c3784a52525889 | |
parent | 46945d805f21ea0c338317050e35296d0b1afdd4 (diff) |
Cycles: small code fix for disabled code.
-rw-r--r-- | intern/cycles/kernel/kernel_light.h | 4 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_path.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h index a056cd71bb1..2bc5a882ce5 100644 --- a/intern/cycles/kernel/kernel_light.h +++ b/intern/cycles/kernel/kernel_light.h @@ -391,6 +391,10 @@ __device float light_sample_pdf(KernelGlobals *kg, LightSample *ls, float3 I, fl __device void light_select(KernelGlobals *kg, int index, float randu, float randv, float3 P, LightSample *ls, float *pdf) { regular_light_sample(kg, index, randu, randv, P, ls, pdf); + + /* compute incoming direction and distance */ + if(ls->t != FLT_MAX) + ls->D = normalize_len(ls->P - P, &ls->t); } __device float light_select_pdf(KernelGlobals *kg, LightSample *ls, float3 I, float t) diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index e0e17ee57dc..e41a5a62c14 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -365,7 +365,7 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R #ifdef __MULTI_LIGHT__ /* index -1 means randomly sample from distribution */ - int i = (kernel_data.integrator.num_distribution)? -1: 0; + int i = (kernel_data.integrator.num_all_lights)? 0: -1; for(; i < kernel_data.integrator.num_all_lights; i++) { #else |