diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-04-30 16:49:26 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-04-30 16:49:26 +0400 |
commit | 1d8c79818870b92df46c443d7778438aa67d019c (patch) | |
tree | ba3fc305671261e40851d8a230a33ebe19396e95 /intern/cycles/render/scene.cpp | |
parent | 796dd8a321108df26757fb9df5c2aa6eb42c9633 (diff) |
Cycles: support for motion vector and UV passes.
Most of the changes are related to adding support for motion data throughout
the code. There's some code for actual camera/object motion blur raytracing
but it's unfinished (it badly slows down the raytracing kernel even when the
option is turned off), so that code it disabled still.
Motion vector export from Blender tries to avoid computing derived meshes
when the mesh does not have a deforming modifier, and it also won't store
motion vectors for every vertex if only the object or camera is moving.
Diffstat (limited to 'intern/cycles/render/scene.cpp')
-rw-r--r-- | intern/cycles/render/scene.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp index 079f2744e73..b6453339d41 100644 --- a/intern/cycles/render/scene.cpp +++ b/intern/cycles/render/scene.cpp @@ -128,7 +128,7 @@ void Scene::device_update(Device *device_, Progress& progress) if(progress.get_cancel()) return; progress.set_status("Updating Camera"); - camera->device_update(device, &dscene); + camera->device_update(device, &dscene, this); if(progress.get_cancel()) return; @@ -166,6 +166,33 @@ void Scene::device_update(Device *device_, Progress& progress) device->const_copy_to("__data", &dscene.data, sizeof(dscene.data)); } +Scene::MotionType Scene::need_motion() +{ + if(integrator->motion_blur) + return MOTION_BLUR; + else if(Pass::contains(film->passes, PASS_MOTION)) + return MOTION_PASS; + else + return MOTION_NONE; +} + +bool Scene::need_global_attribute(AttributeStandard std) +{ + if(std == ATTR_STD_UV) + return Pass::contains(film->passes, PASS_UV); + if(std == ATTR_STD_MOTION_PRE || ATTR_STD_MOTION_POST) + return need_motion() == MOTION_PASS; + + return false; +} + +void Scene::need_global_attributes(AttributeRequestSet& attributes) +{ + for(int std = ATTR_STD_NONE; std < ATTR_STD_NUM; std++) + if(need_global_attribute((AttributeStandard)std)) + attributes.add((AttributeStandard)std); +} + bool Scene::need_update() { return (need_reset() || film->need_update); |