[Bf-blender-cvs] [a325bc6bf3e] blender2.7: Fix T58953: Lamp data not always set

Jeroen Bakker noreply at git.blender.org
Tue Mar 5 14:25:20 CET 2019


Commit: a325bc6bf3e6dace5d1e15330650ea532052c9fc
Author: Jeroen Bakker
Date:   Tue Mar 5 14:22:54 2019 +0100
Branches: blender2.7
https://developer.blender.org/rBa325bc6bf3e6dace5d1e15330650ea532052c9fc

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

===================================================================

M	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
 	}



More information about the Bf-blender-cvs mailing list