Fix T87929: Cycles, missing update when visibility is modified
This issue originates from a missing BVH packing for visibility data when it is modified. To fix this, this adds update flags to the managers to carry the modified visibility information from the Objects' modified flag to the GeometryManager. Another set of flags is added to determine which data need to be packed: geometry, vertices, or visibility. Those flags are then used when packing the primivites. Reviewed By: brecht Maniphest Tasks: T87929 Differential Revision: https://developer.blender.org/D11219
This commit is contained in:
@@ -220,6 +220,10 @@ void Object::tag_update(Scene *scene)
|
||||
flag |= ObjectManager::TRANSFORM_MODIFIED;
|
||||
}
|
||||
|
||||
if (visibility_is_modified()) {
|
||||
flag |= ObjectManager::VISIBILITY_MODIFIED;
|
||||
}
|
||||
|
||||
foreach (Node *node, geometry->get_used_shaders()) {
|
||||
Shader *shader = static_cast<Shader *>(node);
|
||||
if (shader->get_use_mis() && shader->has_surface_emission)
|
||||
@@ -914,6 +918,10 @@ void ObjectManager::tag_update(Scene *scene, uint32_t flag)
|
||||
geometry_flag |= GeometryManager::TRANSFORM_MODIFIED;
|
||||
}
|
||||
|
||||
if ((flag & VISIBILITY_MODIFIED) != 0) {
|
||||
geometry_flag |= GeometryManager::VISIBILITY_MODIFIED;
|
||||
}
|
||||
|
||||
scene->geometry_manager->tag_update(scene, geometry_flag);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user