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.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user