From 755f0183240527e9b274ce4f80f1cf1d7e414164 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 28 Mar 2012 10:39:21 +0000 Subject: Cycles: shadow pass support. Note that this only takes into account lamps, emitting objects or world lighting do not contribute to the shadow pass. Consider this more as a pass useful for some compositing tricks, unlike other lighting passes this pass can't be used to exactly reconstruct the combined pass. --- intern/cycles/kernel/kernel_emission.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'intern/cycles/kernel/kernel_emission.h') diff --git a/intern/cycles/kernel/kernel_emission.h b/intern/cycles/kernel/kernel_emission.h index 2243858a403..764ac599991 100644 --- a/intern/cycles/kernel/kernel_emission.h +++ b/intern/cycles/kernel/kernel_emission.h @@ -60,7 +60,8 @@ __device float3 direct_emissive_eval(KernelGlobals *kg, float rando, } __device bool direct_emission(KernelGlobals *kg, ShaderData *sd, int lindex, - float randt, float rando, float randu, float randv, Ray *ray, BsdfEval *eval) + float randt, float rando, float randu, float randv, Ray *ray, BsdfEval *eval, + bool *is_lamp) { LightSample ls; @@ -135,6 +136,8 @@ __device bool direct_emission(KernelGlobals *kg, ShaderData *sd, int lindex, ray->t = 0.0f; } + *is_lamp = (ls.prim == ~0); + return true; } -- cgit v1.2.3