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
This commit is contained in:
Jeroen Bakker 2019-03-05 14:22:54 +01:00
parent 69c8248a1c
commit a325bc6bf3
Notes: blender-bot 2023-02-14 05:05:54 +01:00
Referenced by issue #59223, Textured spotlights not working in OpenCL GPU compute rendering
Referenced by issue #58953, IES Light texture not working for Opencl GPU render
Referenced by issue #57645, Object Info node random output always returns zero for lights with GPU render (Cycles)
1 changed files with 4 additions and 0 deletions

View File

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