Skip to content

Commit

Permalink
HnMesh: handle visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve J. Cai authored and TheMostDiligent committed Nov 4, 2023
1 parent 95e8c97 commit b35e57a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Hydrogent/src/HnMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ void HnMesh::UpdateRepr(pxr::HdSceneDelegate& SceneDelegate,
pxr::GfMatrix4d Transform = SceneDelegate.GetTransform(Id);
m_Transform = float4x4::MakeMatrix(Transform.data());
}
if (pxr::HdChangeTracker::IsVisibilityDirty(DirtyBits, Id))
{
_sharedData.visible = SceneDelegate.GetVisible(Id);
}

DirtyBits &= ~pxr::HdChangeTracker::NewRepr;
}
Expand Down
3 changes: 0 additions & 3 deletions Hydrogent/src/HnRenderPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ void HnRenderPass::_Execute(const pxr::HdRenderPassStateSharedPtr& RPState,
if (pRPrim == nullptr)
continue;

if (!pRPrim->IsVisible())
continue;

const auto& MaterialId = pRPrim->GetMaterialId();
const pxr::HdSprim* pMaterial = pRenderIndex->GetSprim(pxr::HdPrimTypeTokens->material, MaterialId);
if (pMaterial == nullptr)
Expand Down

0 comments on commit b35e57a

Please sign in to comment.