diff options
author | Stefan Werner <stefan.werner@tangent-animation.com> | 2017-12-02 05:28:13 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-01-11 04:58:29 +0300 |
commit | 25b794a39d8cff87b6df2338d020e8d4ba90eeef (patch) | |
tree | 8a981b760e13061e8a8b9f142f2331822c73de2d /intern/cycles/kernel/geom | |
parent | ac2ebf9c54a9081662ab17f04240c00d9e5ac799 (diff) |
Cycles: support animated object scale in motion blur.
This was disabled previously due to CUDA compiler bugs, see T32900.
Differential Revision: https://developer.blender.org/D2937
Diffstat (limited to 'intern/cycles/kernel/geom')
-rw-r--r-- | intern/cycles/kernel/geom/geom_attribute.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_object.h | 34 |
2 files changed, 21 insertions, 15 deletions
diff --git a/intern/cycles/kernel/geom/geom_attribute.h b/intern/cycles/kernel/geom/geom_attribute.h index 18f5c813cc8..c72595eed10 100644 --- a/intern/cycles/kernel/geom/geom_attribute.h +++ b/intern/cycles/kernel/geom/geom_attribute.h @@ -53,7 +53,7 @@ ccl_device_inline AttributeDescriptor attribute_not_found() ccl_device_inline uint object_attribute_map_offset(KernelGlobals *kg, int object) { - int offset = object*OBJECT_SIZE + 11; + int offset = object*OBJECT_SIZE + 15; float4 f = kernel_tex_fetch(__objects, offset); return __float_as_uint(f.y); } diff --git a/intern/cycles/kernel/geom/geom_object.h b/intern/cycles/kernel/geom/geom_object.h index a276096a745..d77c40f2348 100644 --- a/intern/cycles/kernel/geom/geom_object.h +++ b/intern/cycles/kernel/geom/geom_object.h @@ -28,11 +28,12 @@ CCL_NAMESPACE_BEGIN enum ObjectTransform { OBJECT_TRANSFORM = 0, - OBJECT_TRANSFORM_MOTION_PRE = 0, OBJECT_INVERSE_TRANSFORM = 4, - OBJECT_TRANSFORM_MOTION_POST = 4, - OBJECT_PROPERTIES = 8, - OBJECT_DUPLI = 9 + OBJECT_TRANSFORM_MOTION_PRE = 0, + OBJECT_TRANSFORM_MOTION_MID = 4, + OBJECT_TRANSFORM_MOTION_POST = 8, + OBJECT_PROPERTIES = 12, + OBJECT_DUPLI = 13 }; enum ObjectVectorTransform { @@ -90,19 +91,24 @@ ccl_device_inline Transform object_fetch_vector_transform(KernelGlobals *kg, int #ifdef __OBJECT_MOTION__ ccl_device_inline Transform object_fetch_transform_motion(KernelGlobals *kg, int object, float time) { - DecompMotionTransform motion; + MotionTransform motion; int offset = object*OBJECT_SIZE + (int)OBJECT_TRANSFORM_MOTION_PRE; - motion.mid.x = kernel_tex_fetch(__objects, offset + 0); - motion.mid.y = kernel_tex_fetch(__objects, offset + 1); - motion.mid.z = kernel_tex_fetch(__objects, offset + 2); - motion.mid.w = kernel_tex_fetch(__objects, offset + 3); + motion.pre.x = kernel_tex_fetch(__objects, offset + 0); + motion.pre.y = kernel_tex_fetch(__objects, offset + 1); + motion.pre.z = kernel_tex_fetch(__objects, offset + 2); + motion.pre.w = kernel_tex_fetch(__objects, offset + 3); + + motion.mid.x = kernel_tex_fetch(__objects, offset + 4); + motion.mid.y = kernel_tex_fetch(__objects, offset + 5); + motion.mid.z = kernel_tex_fetch(__objects, offset + 6); + motion.mid.w = kernel_tex_fetch(__objects, offset + 7); - motion.pre_x = kernel_tex_fetch(__objects, offset + 4); - motion.pre_y = kernel_tex_fetch(__objects, offset + 5); - motion.post_x = kernel_tex_fetch(__objects, offset + 6); - motion.post_y = kernel_tex_fetch(__objects, offset + 7); + motion.post.x = kernel_tex_fetch(__objects, offset + 8); + motion.post.y = kernel_tex_fetch(__objects, offset + 9); + motion.post.z = kernel_tex_fetch(__objects, offset + 10); + motion.post.w = kernel_tex_fetch(__objects, offset + 11); Transform tfm; transform_motion_interpolate(&tfm, &motion, time); @@ -328,7 +334,7 @@ ccl_device_inline uint object_patch_map_offset(KernelGlobals *kg, int object) if(object == OBJECT_NONE) return 0; - int offset = object*OBJECT_SIZE + 11; + int offset = object*OBJECT_SIZE + 15; float4 f = kernel_tex_fetch(__objects, offset); return __float_as_uint(f.x); } |