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/film.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/film.cpp')
-rw-r--r-- | intern/cycles/render/film.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp index cc17f86fcb6..55c89b7b1b2 100644 --- a/intern/cycles/render/film.cpp +++ b/intern/cycles/render/film.cpp @@ -67,6 +67,13 @@ void Pass::add(PassType type, vector<Pass>& passes) case PASS_UV: pass.components = 4; break; + case PASS_MOTION: + pass.components = 4; + pass.divide_type = PASS_MOTION_WEIGHT; + break; + case PASS_MOTION_WEIGHT: + pass.components = 1; + break; case PASS_OBJECT_ID: pass.components = 1; pass.filter = false; @@ -154,6 +161,15 @@ bool Pass::equals(const vector<Pass>& A, const vector<Pass>& B) return true; } +bool Pass::contains(const vector<Pass>& passes, PassType type) +{ + foreach(const Pass& pass, passes) + if(pass.type == type) + return true; + + return false; +} + /* Film */ Film::Film() @@ -196,6 +212,12 @@ void Film::device_update(Device *device, DeviceScene *dscene) case PASS_UV: kfilm->pass_uv = kfilm->pass_stride; break; + case PASS_MOTION: + kfilm->pass_motion = kfilm->pass_stride; + break; + case PASS_MOTION_WEIGHT: + kfilm->pass_motion_weight = kfilm->pass_stride; + break; case PASS_OBJECT_ID: kfilm->pass_object_id = kfilm->pass_stride; break; |