diff options
author | Mai Lavelle <mai.lavelle@gmail.com> | 2016-09-03 04:37:17 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-09-14 11:26:21 +0300 |
commit | fd01cd7d06fdb9e1c80070a46c0abc93e2f604e6 (patch) | |
tree | e48f463130cdfa19c73bd4903a319c1a9bda56c9 /intern/cycles/kernel/geom/geom_object.h | |
parent | 2c1201502dcac7c3febd7e09c228b05dd16b4fcd (diff) |
Cycles: Replace object index hack with actual checks for SD_TRANSFORM_APPLIED
Using ones complement for detecting if transform has been applied was confusing
and led to several bugs. With this proper checks are made.
Also added a few transforms where they were missing, mostly affecting baking
and displacement when `P` is used in the shader (previously `P` was in the
wrong space for these shaders)
Also removed `TIME_INVALID` as this may have resulted in incorrect
transforms in some cases.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D2192
Diffstat (limited to 'intern/cycles/kernel/geom/geom_object.h')
-rw-r--r-- | intern/cycles/kernel/geom/geom_object.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/intern/cycles/kernel/geom/geom_object.h b/intern/cycles/kernel/geom/geom_object.h index 883c5dc100d..4f72c5b7b93 100644 --- a/intern/cycles/kernel/geom/geom_object.h +++ b/intern/cycles/kernel/geom/geom_object.h @@ -564,6 +564,15 @@ ccl_device_inline void bvh_instance_motion_pop_factor(KernelGlobals *kg, */ #ifdef __KERNEL_OPENCL__ +ccl_device_inline void object_position_transform_addrspace(KernelGlobals *kg, + const ShaderData *sd, + ccl_addr_space float3 *P) +{ + float3 private_P = *P; + object_position_transform(kg, sd, &private_P); + *P = private_P; +} + ccl_device_inline void object_dir_transform_addrspace(KernelGlobals *kg, const ShaderData *sd, ccl_addr_space float3 *D) @@ -584,9 +593,11 @@ ccl_device_inline void object_normal_transform_addrspace(KernelGlobals *kg, #endif #ifndef __KERNEL_OPENCL__ +# define object_position_transform_auto object_position_transform # define object_dir_transform_auto object_dir_transform # define object_normal_transform_auto object_normal_transform #else +# define object_position_transform_auto object_position_transform_addrspace # define object_dir_transform_auto object_dir_transform_addrspace # define object_normal_transform_auto object_normal_transform_addrspace #endif |