Skip to content

Commit c1b1daf

Browse files
committed
Adding comments to RPI occlusion culling call site
Signed-off-by: Guthrie Adams <[email protected]>
1 parent 7eb8543 commit c1b1daf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,10 @@ namespace AZ
490490
worklistData->m_sceneEntityContextId,
491491
[&](AzFramework::OcclusionRequestBus::Events* handler)
492492
{
493+
// An occlusion culling system might precompute visibility data for static objects or entities in a scene. If the
494+
// system that implements OcclusionRequestBus supports that behavior then we want to perform an initial visibility
495+
// test using the entity ID. This can avoid potentially more expensive dynamic tests, like those against an
496+
// occlusion buffer.
493497
if (visibleEntry->m_typeFlags & AzFramework::VisibilityEntry::TYPE_RPI_Cullable)
494498
{
495499
auto cullable = static_cast<RPI::Cullable*>(visibleEntry->m_userData);
@@ -499,6 +503,9 @@ namespace AZ
499503
}
500504
}
501505

506+
// Entries that don't meet the above criteria or return an inconclusive or partially visible state will perform a
507+
// dynamic, bounding box visibility test. One entity can have multiple visibility entries that may need to be tested
508+
// individually. If the entire entity is hidden, no further testing is required.
502509
if (state != AzFramework::OcclusionState::Hidden)
503510
{
504511
state = handler->GetOcclusionViewAabbVisibility(viewName, visibleEntry->m_boundingVolume);

0 commit comments

Comments
 (0)