Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::RPI::CullingScene Class Reference

#include <Culling.h>


struct  OcclusionPlane

Public Types

using OcclusionPlaneVector = AZStd::vector< OcclusionPlane >

Public Member Functions

 AZ_RTTI (CullingScene, "{5B23B55B-8A1D-4B0D-9760-15E87FC8518A}")
 AZ_CLASS_ALLOCATOR (CullingScene, AZ::SystemAllocator)
void Activate (const class Scene *parentScene)
void Deactivate ()
void SetOcclusionPlanes (const OcclusionPlaneVector &occlusionPlanes)
 Sets a list of occlusion planes to be used during the culling process.
void BeginCulling (const AZStd::vector< ViewPtr > &views)
 Notifies the CullingScene that culling will begin for this frame.
void EndCulling ()
 Notifies the CullingScene that the culling is done for this frame.
void ProcessCullables (const Scene &scene, View &view, AZ::Job *parentJob, AZ::TaskGraph *taskGraph=nullptr, AZ::TaskGraphEvent *processCullablesTGEvent=nullptr)
void ProcessCullablesJobsEntries (const Scene &scene, View &view, AZ::Job *parentJob)
void ProcessCullablesJobs (const Scene &scene, View &view, AZ::Job &parentJob)
 Will create child jobs under the parentJob to do the processing in parallel.
void ProcessCullablesTG (const Scene &scene, View &view, AZ::TaskGraph &taskGraph, AZ::TaskGraphEvent &processCullablesTGEvent)
 Will create child task graphs that signal the TaskGraphEvent to do the processing in parallel.
void RegisterOrUpdateCullable (Cullable &cullable)
void UnregisterCullable (Cullable &cullable)
uint32_t GetNumCullables () const
 Returns the number of cullables that have been added to the CullingScene.
CullingDebugContextGetDebugContext ()
const AzFramework::IVisibilityScene * GetVisibilityScene () const
 Returns the visibility scene.

Protected Member Functions

size_t CountObjectsInScene ()

Detailed Description

Centralized manager for culling-related processing for a given scene. There is one CullingScene owned by each Scene, so external systems (such as FeatureProcessors) should access the CullingScene via their parent Scene.

Member Function Documentation

◆ ProcessCullables()

void AZ::RPI::CullingScene::ProcessCullables ( const Scene scene,
View view,
AZ::Job *  parentJob,
AZ::TaskGraph *  taskGraph = nullptr,
AZ::TaskGraphEvent *  processCullablesTGEvent = nullptr 

Performs render culling and lod selection for a View, then adds the visible renderpackets to that View. Must be called between BeginCulling() and EndCulling(), once for each active scene/view pair. Can be called in parallel (i.e. to perform culling on multiple views at the same time).

◆ ProcessCullablesJobsEntries()

void AZ::RPI::CullingScene::ProcessCullablesJobsEntries ( const Scene scene,
View view,
AZ::Job *  parentJob 

Variation that accumulates entries into lists to hand off to jobs. This yieldeds more balanced jobs and thus better performance than the above Nodes variation. Use the r_useEntryWorkListsForCulling CVAR to toggle between the two.

◆ RegisterOrUpdateCullable()

void AZ::RPI::CullingScene::RegisterOrUpdateCullable ( Cullable cullable)

Adds a Cullable to the underlying visibility system(s). Must be called at least once on initialization and whenever a Cullable's position or bounds is changed. Is not thread-safe, so call this from the main thread outside of Begin/EndCulling()

◆ UnregisterCullable()

void AZ::RPI::CullingScene::UnregisterCullable ( Cullable cullable)

Removes a Cullable from the underlying visibility system(s). Must be called once for each cullable object on de-initialization. Is not thread-safe, so call this from the main thread outside of Begin/EndCulling()

The documentation for this class was generated from the following file: