Fix T53755: Cycles OpenCL lamp shaders have incorrect normal.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 11 Jan 2018 07:42:57 +0000 (08:42 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 11 Jan 2018 07:48:32 +0000 (08:48 +0100)
intern/cycles/kernel/geom/geom_object.h

index d77c40f234823b5b3e3e898473cbbc1ada88cf98..fa0dff4bd57b42afbf1a1625a1575c7804c00af3 100644 (file)
@@ -175,6 +175,10 @@ ccl_device_inline void object_inverse_normal_transform(KernelGlobals *kg, const
                Transform tfm = object_fetch_transform(kg, sd->object, OBJECT_TRANSFORM);
                *N = normalize(transform_direction_transposed(&tfm, *N));
        }
+       else if(sd->type == PRIMITIVE_LAMP) {
+               Transform tfm = lamp_fetch_transform(kg, sd->lamp, false);
+               *N = normalize(transform_direction_transposed(&tfm, *N));
+       }
 #endif
 }