Cycles: Ignore zero size instances in BVH

In certain types of animation it's possible to have some objects
scaling to zero. In this case we can save render times by avoid
traversing such instances.

Better to do ti ahead of a time, so traversal stays simple.

Reviewers: lukasstockner97, dingto, brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2048
This commit is contained in:
Sergey Sharybin
2016-06-06 09:15:34 +02:00
parent b62faa54de
commit 6046c03f5c
3 changed files with 21 additions and 0 deletions

View File

@@ -225,6 +225,16 @@ vector<float> Object::motion_times()
return times;
}
bool Object::is_traceable()
{
/* Mesh itself can be empty,can skip all such objects. */
if (bounds.size() == make_float3(0.0f, 0.0f, 0.0f)) {
return false;
}
/* TODO(sergey): Check for mesh vertices/curves. visibility flags. */
return true;
}
/* Object Manager */
ObjectManager::ObjectManager()