diff --git a/Hydrogent/src/HnMesh.cpp b/Hydrogent/src/HnMesh.cpp index 487c0dba..682ffc13 100644 --- a/Hydrogent/src/HnMesh.cpp +++ b/Hydrogent/src/HnMesh.cpp @@ -85,6 +85,8 @@ void HnMesh::Sync(pxr::HdSceneDelegate* Delegate, m_MaterialId = Delegate->GetMaterialId(Id); } + _UpdateVisibility(Delegate, DirtyBits); + *DirtyBits &= ~pxr::HdChangeTracker::AllSceneDirtyBits; } diff --git a/Hydrogent/src/HnRendererImpl.cpp b/Hydrogent/src/HnRendererImpl.cpp index 40dde52a..13a98151 100644 --- a/Hydrogent/src/HnRendererImpl.cpp +++ b/Hydrogent/src/HnRendererImpl.cpp @@ -238,6 +238,8 @@ void HnRendererImpl::Draw(IDeviceContext* pCtx, const HnDrawAttribs& Attribs) continue; auto& Mesh = *mesh_it.second; + if (!Mesh.IsVisible()) + continue; const auto& MaterialId = Mesh.GetMaterialId(); const auto* pMaterial = m_RenderDelegate->GetMaterial(MaterialId.GetText());