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