forked from blender/blender
Implement instancing for light objects #35
@ -63,19 +63,12 @@ void InstancerData::update()
|
||||
{
|
||||
ID_LOG(2, "");
|
||||
|
||||
pxr::HdDirtyBits bits = pxr::HdChangeTracker::Clean;
|
||||
|
||||
Object *object = (Object *)id;
|
||||
if ((id->recalc & ID_RECALC_GEOMETRY) || (((ID *)object->data)->recalc & ID_RECALC_GEOMETRY)) {
|
||||
if (id->recalc & ID_RECALC_GEOMETRY || ((ID *)object->data)->recalc & ID_RECALC_GEOMETRY ||
|
||||
id->recalc & ID_RECALC_TRANSFORM) {
|
||||
set_instances();
|
||||
bits |= pxr::HdChangeTracker::AllDirty;
|
||||
}
|
||||
else if (id->recalc & ID_RECALC_TRANSFORM) {
|
||||
set_instances();
|
||||
bits |= pxr::HdChangeTracker::DirtyTransform;
|
||||
}
|
||||
if (bits != pxr::HdChangeTracker::Clean) {
|
||||
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkInstancerDirty(prim_id, bits);
|
||||
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkInstancerDirty(
|
||||
prim_id, pxr::HdChangeTracker::AllDirty);
|
||||
}
|
||||
}
|
||||
|
||||
@ -168,13 +161,10 @@ void InstancerData::check_update(Object *object)
|
||||
if (m_it != mesh_instances_.end()) {
|
||||
m_it->second.data->update();
|
||||
|
||||
pxr::HdDirtyBits bits = pxr::HdChangeTracker::Clean;
|
||||
if (m_it->second.data->id->recalc & ID_RECALC_TRANSFORM) {
|
||||
set_instances();
|
||||
bits |= pxr::HdChangeTracker::DirtyTransform;
|
||||
}
|
||||
if (bits != pxr::HdChangeTracker::Clean) {
|
||||
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkInstancerDirty(prim_id, bits);
|
||||
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkInstancerDirty(
|
||||
prim_id, pxr::HdChangeTracker::AllDirty);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user