Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-06-07 03:27:38 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-06-07 03:27:38 +0400
commit5ebc88266e71249e664e994e081627c926faf89e (patch)
tree8842dd530ead055ce8d3d33f90c3784a52525889 /intern/cycles
parent46945d805f21ea0c338317050e35296d0b1afdd4 (diff)
Cycles: small code fix for disabled code.
Diffstat (limited to 'intern/cycles')
-rw-r--r--intern/cycles/kernel/kernel_light.h4
-rw-r--r--intern/cycles/kernel/kernel_path.h2
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