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/kernel/kernel_light.h
parent46945d805f21ea0c338317050e35296d0b1afdd4 (diff)
Cycles: small code fix for disabled code.
Diffstat (limited to 'intern/cycles/kernel/kernel_light.h')
-rw-r--r--intern/cycles/kernel/kernel_light.h4
1 files changed, 4 insertions, 0 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)