Cycles: Implement camera zoom motion blur

Works totally similar to camera motion blur and majority of the changes are
related on just passing extra arguments to sync() functions.

Couple of things still to look into:

- Motion pass will not include motion caused by the zoom.
- Only perspective cameras are supported currently.
- Motion is being interpolated on projected coordinates, which might give
  different results from constructing projection matrix from interpolated
  field of view.

  This could be good enough for us, but we need to consider improving this
  at some point.

Reviewers: juicyfruit, dingto

Reviewed By: dingto

Differential Revision: https://developer.blender.org/D1383
This commit is contained in:
2015-07-21 15:36:35 +02:00
parent 1df42798d4
commit dc3563ff48
10 changed files with 199 additions and 39 deletions

View File

@@ -659,7 +659,11 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, float motion_time)
mesh_motion_synced.clear();
}
void BlenderSync::sync_motion(BL::SpaceView3D b_v3d, BL::Object b_override, void **python_thread_state)
void BlenderSync::sync_motion(BL::RenderSettings b_render,
BL::SpaceView3D b_v3d,
BL::Object b_override,
int width, int height,
void **python_thread_state)
{
if(scene->need_motion() == Scene::MOTION_NONE)
return;
@@ -679,6 +683,9 @@ void BlenderSync::sync_motion(BL::SpaceView3D b_v3d, BL::Object b_override, void
/* note iteration over motion_times set happens in sorted order */
foreach(float relative_time, motion_times) {
VLOG(1) << "Synchronizing motion for the relative time "
<< relative_time << ".";
/* fixed shutter time to get previous and next frame for motion pass */
float shuttertime;
@@ -698,8 +705,12 @@ void BlenderSync::sync_motion(BL::SpaceView3D b_v3d, BL::Object b_override, void
python_thread_state_save(python_thread_state);
/* sync camera, only supports two times at the moment */
if(relative_time == -1.0f || relative_time == 1.0f)
sync_camera_motion(b_cam, relative_time);
if(relative_time == -1.0f || relative_time == 1.0f) {
sync_camera_motion(b_render,
b_cam,
width, height,
relative_time);
}
/* sync object */
sync_objects(b_v3d, relative_time);