From a325bc6bf3e6dace5d1e15330650ea532052c9fc Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 5 Mar 2019 14:22:54 +0100 Subject: Fix T58953: Lamp data not always set The Lamp data was not always set. When using CUDA or CPU it was, but when using OpenCL without `OBJECT_MOTION` `sd->lamp` not updated to the actual lamp. This made the TextureCoordinate output the wrong normal when used in a light shader. As the normal was incorrect it made the IES node render incorrectly. (what is the default for the IES node). By setting the lamp data when no `__OBJECT_MOTION__` compile directive is present makes sure that the normal is correctly calculated. Fix D4450 Reviewed By: Brecht van Lommel --- intern/cycles/kernel/kernel_shader.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'intern/cycles/kernel/kernel_shader.h') diff --git a/intern/cycles/kernel/kernel_shader.h b/intern/cycles/kernel/kernel_shader.h index 0789031f44f..d573270fd76 100644 --- a/intern/cycles/kernel/kernel_shader.h +++ b/intern/cycles/kernel/kernel_shader.h @@ -299,6 +299,10 @@ ccl_device_inline void shader_setup_from_sample(KernelGlobals *kg, sd->ob_tfm = lamp_fetch_transform(kg, lamp, false); sd->ob_itfm = lamp_fetch_transform(kg, lamp, true); sd->lamp = lamp; +#else + } + else if(lamp != LAMP_NONE) { + sd->lamp = lamp; #endif } -- cgit v1.2.3