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::Scene Class Referencefinal

Inherits SceneRequestBus::Handler.

Classes

struct  PipelineStateData
 

Public Types

typedef AZStd::vector< PipelineStateDataPipelineStateList
 
using FeatureProcessorVisitCallback = AZStd::function< bool(FeatureProcessor &)>
 
using PrepareSceneSrgEvent = AZ::Event< RPI::ShaderResourceGroup * >
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (Scene, AZ::SystemAllocator)
 
 AZ_RTTI (Scene, "{29860D3E-D57E-41D9-8624-C39604EF2973}")
 
void Activate ()
 
void Deactivate ()
 
template<typename FeatureProcessorType >
FeatureProcessorType * EnableFeatureProcessor ()
 
FeatureProcessorEnableFeatureProcessor (const FeatureProcessorId &featureProcessorId)
 
void EnableAllFeatureProcessors ()
 Enable all feature processors which were available (registered in feature processor factory) for this scene.
 
template<typename FeatureProcessorType >
void DisableFeatureProcessor ()
 
void DisableFeatureProcessor (const FeatureProcessorId &featureProcessorId)
 
void DisableAllFeatureProcessors ()
 
void VisitFeatureProcessor (FeatureProcessorVisitCallback callback) const
 
template<typename FeatureProcessorType >
FeatureProcessorType * GetFeatureProcessor () const
 
FeatureProcessorGetFeatureProcessor (const FeatureProcessorId &featureProcessorId) const
 
FeatureProcessorGetFeatureProcessor (const TypeId &featureProcessorTypeId) const
 
RenderPipelinePtr GetRenderPipeline (const RenderPipelineId &pipelineId) const
 Get pipeline by name id.
 
void AddRenderPipeline (RenderPipelinePtr pipeline)
 
void RemoveRenderPipeline (const RenderPipelineId &pipelineId)
 
const RHI::ShaderResourceGroupGetRHIShaderResourceGroup () const
 
Data::Instance< ShaderResourceGroupGetShaderResourceGroup () const
 
const SceneId & GetId () const
 
AZ::Name GetName () const
 
bool SetDefaultRenderPipeline (const RenderPipelineId &pipelineId)
 
RenderPipelinePtr GetDefaultRenderPipeline () const
 Return default pipeline. If the default pipeline wasn't set, then it would return nullptr.
 
const AZStd::vector< RenderPipelinePtr > & GetRenderPipelines () const
 Return all added render pipelines in this scene.
 
bool ConfigurePipelineState (RHI::DrawListTag drawListTag, RHI::PipelineStateDescriptorForDraw &outPipelineState) const
 
const PipelineStateList & GetPipelineStates (RHI::DrawListTag drawListTag) const
 
bool HasOutputForPipelineState (RHI::DrawListTag drawListTag) const
 
AzFramework::IVisibilityScene * GetVisibilityScene () const
 
AZ::RPI::CullingSceneGetCullingScene () const
 
RenderPipelinePtr FindRenderPipelineForWindow (AzFramework::NativeWindowHandle windowHandle, ViewType viewType=ViewType::Default)
 
void ConnectEvent (PrepareSceneSrgEvent::Handler &handler)
 
void RebuildPipelineStatesLookup ()
 
void TryApplyRenderPipelineChanges (RenderPipeline *pipeline)
 Try apply render pipeline changes from each feature processors if the pipeline allows modification and wasn't modified.
 
RHI::TagBitRegistry< uint32_t > & GetViewTagBitRegistry ()
 
RHI::Ptr< RHI::DrawFilterTagRegistryGetDrawFilterTagRegistry () const
 
uint16_t GetActiveRenderPipelines () const
 

Static Public Member Functions

static ScenePtr CreateScene (const SceneDescriptor &sceneDescriptor)
 
static ScenePtr CreateSceneFromAsset (Data::Asset< AnyAsset > sceneAsset)
 
static SceneGetSceneForEntityContextId (AzFramework::EntityContextId entityContextId)
 
static SceneGetSceneForEntityId (AZ::EntityId entityId)
 Gets the RPI::Scene for a given entityId.
 
template<typename FeatureProcessorType >
static FeatureProcessorType * GetFeatureProcessorForEntity (AZ::EntityId entityId)
 
template<typename FeatureProcessorType >
static FeatureProcessorType * GetFeatureProcessorForEntityContextId (AzFramework::EntityContextId entityContextId)
 

Protected Member Functions

void OnSceneNotificationHandlerConnected (SceneNotification *handler) override
 
void PipelineStateLookupNeedsRebuild () override
 
void Simulate (RHI::JobPolicy jobPolicy, float simulationTime)
 
void PrepareRender (RHI::JobPolicy jobPolicy, float simulationTime)
 
void OnFrameEnd ()
 
void UpdateSrgs ()
 

Friends

class FeatureProcessorFactory
 
class RPISystem
 

Member Typedef Documentation

◆ FeatureProcessorVisitCallback

Callback function that will be invoked with each non-pointer FeatureProcessor return true to continue visiting or false to halt

Member Function Documentation

◆ ConfigurePipelineState()

bool AZ::RPI::Scene::ConfigurePipelineState ( RHI::DrawListTag  drawListTag,
RHI::PipelineStateDescriptorForDraw outPipelineState 
) const

Configure some pipeline state data from scene's passes associated with specified DrawListTag. The pipeline states which will be set may include: OutputAttachmentLayout; MultisampleState. If the current scene's render pipeline doesn't contain the DrawListTag, it returns false and failed to configure the pipeline state And the caller shouldn't need to continue creating draw data with this pipeline state.

◆ ConnectEvent()

void AZ::RPI::Scene::ConnectEvent ( PrepareSceneSrgEvent::Handler &  handler)

Connect a handler to listen to the event that the Scene is ready to update and compile its scene srg User should use this event to update the part scene srg they know of

◆ DisableFeatureProcessor()

template<typename FeatureProcessorType >
void AZ::RPI::Scene::DisableFeatureProcessor

Disables a feature processor type from the scene, only if was previously enabled.

◆ EnableFeatureProcessor()

template<typename FeatureProcessorType >
FeatureProcessorType * AZ::RPI::Scene::EnableFeatureProcessor

Enables a feature processor type for this scene. Only a single instance of feature processor type is allowed to be active per scene. The order in which feature processors are enabled is the order in which feature processors will be updated when updating is single threaded.

◆ GetFeatureProcessor()

template<typename FeatureProcessorType >
FeatureProcessorType * AZ::RPI::Scene::GetFeatureProcessor

Linear search to retrieve specific class of a feature processor. Returns nullptr if a feature processor with the specified id is not found.

◆ GetSceneForEntityContextId()

static Scene * AZ::RPI::Scene::GetSceneForEntityContextId ( AzFramework::EntityContextId  entityContextId)
static

Gets the RPI::Scene for a given entityContextId. May return nullptr if there is no RPI::Scene created for that entityContext.

◆ RebuildPipelineStatesLookup()

void AZ::RPI::Scene::RebuildPipelineStatesLookup ( )

Rebuild pipeline states lookup table. This function is called every time scene's render pipelines change. User may call this function explicitly if render pipelines were changed

◆ SetDefaultRenderPipeline()

bool AZ::RPI::Scene::SetDefaultRenderPipeline ( const RenderPipelineId &  pipelineId)

Set default pipeline by render pipeline ID. It returns true if the default render pipeline was set from the input ID. If the specified render pipeline doesn't exist in this scene then it won't do anything and returns false.


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