Open 3D Engine Atom Gem API Reference
24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
Inherits SceneRequestBus::Handler.
Classes | |
struct | PipelineStateData |
Public Types | |
typedef AZStd::vector< PipelineStateData > | PipelineStateList |
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 () |
FeatureProcessor * | EnableFeatureProcessor (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 |
FeatureProcessor * | GetFeatureProcessor (const FeatureProcessorId &featureProcessorId) const |
FeatureProcessor * | GetFeatureProcessor (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::ShaderResourceGroup * | GetRHIShaderResourceGroup () const |
Data::Instance< ShaderResourceGroup > | GetShaderResourceGroup () 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::CullingScene * | GetCullingScene () 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::DrawFilterTagRegistry > | GetDrawFilterTagRegistry () const |
uint16_t | GetActiveRenderPipelines () const |
Static Public Member Functions | |
static ScenePtr | CreateScene (const SceneDescriptor &sceneDescriptor) |
static ScenePtr | CreateSceneFromAsset (Data::Asset< AnyAsset > sceneAsset) |
static Scene * | GetSceneForEntityContextId (AzFramework::EntityContextId entityContextId) |
static Scene * | GetSceneForEntityId (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 |
using AZ::RPI::Scene::FeatureProcessorVisitCallback = AZStd::function<bool(FeatureProcessor&)> |
Callback function that will be invoked with each non-pointer FeatureProcessor return true to continue visiting or false to halt
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.
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
void AZ::RPI::Scene::DisableFeatureProcessor |
Disables a feature processor type from the scene, only if was previously enabled.
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.
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.
|
static |
Gets the RPI::Scene for a given entityContextId. May return nullptr if there is no RPI::Scene created for that entityContext.
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
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.