diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-07 22:59:23 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-07 22:59:23 +0400 |
commit | 58a290234b0719ce48854e2f6744575b353bf7d3 (patch) | |
tree | 8891bc5663c9b8e19cdaa2a1d58ec0e39ff3f2f3 /intern/cycles/kernel/kernel_light.h | |
parent | b20a7e01d046b95a79663da1a8072358709a5a8b (diff) |
Cycles: ray visibility options now work for lamps and mesh lights, with and without
multiple importance sampling, so you can disable them for diffuse/glossy/transmission.
The Light Path node here is still weak and does not give this info. To make that
work we'd need to evaluate the shader multiple times which is slow and we can't
detect well enough when it is actually needed.
Diffstat (limited to 'intern/cycles/kernel/kernel_light.h')
-rw-r--r-- | intern/cycles/kernel/kernel_light.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h index 9f198c6c595..4983122fb34 100644 --- a/intern/cycles/kernel/kernel_light.h +++ b/intern/cycles/kernel/kernel_light.h @@ -558,11 +558,11 @@ __device void light_sample(KernelGlobals *kg, float randt, float randu, float ra if(prim >= 0) { int object = __float_as_int(l.w); #ifdef __HAIR__ - int segment = __float_as_int(l.z); + int segment = __float_as_int(l.z) & SHADER_MASK; #endif #ifdef __HAIR__ - if (segment != (int)~0) + if (segment != SHADER_MASK) curve_segment_light_sample(kg, prim, object, segment, randu, randv, time, ls); else #endif @@ -571,6 +571,7 @@ __device void light_sample(KernelGlobals *kg, float randt, float randu, float ra /* compute incoming direction, distance and pdf */ ls->D = normalize_len(ls->P - P, &ls->t); ls->pdf = triangle_light_pdf(kg, ls->Ng, -ls->D, ls->t); + ls->shader |= __float_as_int(l.z) & (~SHADER_MASK); } else { int lamp = -prim-1; |