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/render | |
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/render')
-rw-r--r-- | intern/cycles/render/camera.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/render/object.cpp | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp index 83ff8a10618..9b226140f08 100644 --- a/intern/cycles/render/camera.cpp +++ b/intern/cycles/render/camera.cpp @@ -353,7 +353,7 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene) #ifdef __CAMERA_MOTION__ else if(need_motion == Scene::MOTION_BLUR) { if(use_motion) { - transform_motion_decompose((DecompMotionTransform*)&kcam->motion, &motion, &matrix); + transform_motion_decompose(&kcam->motion, &motion, &matrix); kcam->have_motion = 1; } if(use_perspective_motion) { diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp index d7143f24850..380c12fa6b2 100644 --- a/intern/cycles/render/object.cpp +++ b/intern/cycles/render/object.cpp @@ -97,7 +97,7 @@ void Object::compute_bounds(bool motion_blur) mtfm.post = tfm; } - DecompMotionTransform decomp; + MotionTransform decomp; transform_motion_decompose(&decomp, &mtfm, &tfm); bounds = BoundBox::empty; @@ -365,7 +365,7 @@ void ObjectManager::device_update_object_transform(UpdateObejctTransformState *s /* OBJECT_INVERSE_TRANSFORM */ memcpy(&objects[offset+4], &itfm, sizeof(float4)*3); /* OBJECT_PROPERTIES */ - objects[offset+8] = make_float4(surface_area, pass_id, random_number, __int_as_float(particle_index)); + objects[offset+12] = make_float4(surface_area, pass_id, random_number, __int_as_float(particle_index)); if(mesh->use_motion_blur) { state->have_motion = true; @@ -402,10 +402,10 @@ void ObjectManager::device_update_object_transform(UpdateObejctTransformState *s else if(state->need_motion == Scene::MOTION_BLUR) { if(ob->use_motion) { /* decompose transformations for interpolation. */ - DecompMotionTransform decomp; + MotionTransform decomp; transform_motion_decompose(&decomp, &ob->motion, &ob->tfm); - memcpy(&objects[offset], &decomp, sizeof(float4)*8); + memcpy(&objects[offset], &decomp, sizeof(float4)*12); flag |= SD_OBJECT_MOTION; state->have_motion = true; } @@ -418,9 +418,9 @@ void ObjectManager::device_update_object_transform(UpdateObejctTransformState *s int numverts = mesh->verts.size(); int numkeys = mesh->curve_keys.size(); - objects[offset+9] = make_float4(ob->dupli_generated[0], ob->dupli_generated[1], ob->dupli_generated[2], __int_as_float(numkeys)); - objects[offset+10] = make_float4(ob->dupli_uv[0], ob->dupli_uv[1], __int_as_float(numsteps), __int_as_float(numverts)); - objects[offset+11] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); + objects[offset+13] = make_float4(ob->dupli_generated[0], ob->dupli_generated[1], ob->dupli_generated[2], __int_as_float(numkeys)); + objects[offset+14] = make_float4(ob->dupli_uv[0], ob->dupli_uv[1], __int_as_float(numsteps), __int_as_float(numverts)); + objects[offset+15] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); /* Object flag. */ if(ob->use_holdout) { @@ -655,7 +655,7 @@ void ObjectManager::device_update_mesh_offsets(Device *, DeviceScene *dscene, Sc foreach(Object *object, scene->objects) { Mesh* mesh = object->mesh; - int offset = object_index*OBJECT_SIZE + 11; + int offset = object_index*OBJECT_SIZE + 15; if(mesh->patch_table) { uint patch_map_offset = 2*(mesh->patch_table_offset + mesh->patch_table->total_size() - |