diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-03-29 16:03:47 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-03-29 16:03:47 +0400 |
commit | e2184c653e1f2cc7e05cf9a42a87d23ea3050eac (patch) | |
tree | dc39ada14e14259a4cd18c2d5974390a585eb7b8 /intern/cycles/bvh/bvh.cpp | |
parent | 6020d0099039ed18c6a6cd330b68361123c85c1a (diff) |
Cycles: add support for curve deformation motion blur.
Diffstat (limited to 'intern/cycles/bvh/bvh.cpp')
-rw-r--r-- | intern/cycles/bvh/bvh.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp index 92ad3cd24a5..770393c9f21 100644 --- a/intern/cycles/bvh/bvh.cpp +++ b/intern/cycles/bvh/bvh.cpp @@ -238,7 +238,6 @@ void BVH::refit(Progress& progress) void BVH::pack_triangle(int idx, float4 woop[3]) { - /* create Woop triangle */ int tob = pack.prim_object[idx]; const Mesh *mesh = objects[tob]->mesh; @@ -642,6 +641,20 @@ void RegularBVH::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility curve.bounds_grow(k, &mesh->curve_keys[0], bbox); visibility |= PATH_RAY_CURVE; + + /* motion curves */ + if(mesh->use_motion_blur) { + Attribute *attr = mesh->curve_attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); + + if(attr) { + size_t mesh_size = mesh->curve_keys.size(); + size_t steps = mesh->motion_steps - 1; + float4 *key_steps = attr->data_float4(); + + for (size_t i = 0; i < steps; i++) + curve.bounds_grow(k, key_steps + i*mesh_size, bbox); + } + } } else { /* triangles */ |