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:
authorJeroen Bakker <j.bakker@atmind.nl>2019-03-05 16:22:54 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-03-05 16:22:54 +0300
commita325bc6bf3e6dace5d1e15330650ea532052c9fc (patch)
treebeb9e1a1e326ae4867675d1800556960aee79e5e /intern/cycles/kernel/kernel_shader.h
parent69c8248a1ce402cec7a3f334024d719979aff43f (diff)
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
Diffstat (limited to 'intern/cycles/kernel/kernel_shader.h')
-rw-r--r--intern/cycles/kernel/kernel_shader.h4
1 files changed, 4 insertions, 0 deletions
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
}