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::RenderPipeline Class Reference

#include <RenderPipeline.h>

Public Types

enum class  RenderMode : uint8_t { RenderEveryTick , RenderOnce , NoRender }
 
using PipelineViewMap = AZStd::unordered_map< PipelineViewTag, PipelineViews >
 
using ViewToViewTagMap = AZStd::map< const View *, PipelineViewTag >
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (RenderPipeline, AZ::SystemAllocator)
 
void UnregisterView (ViewPtr view)
 
void SetPersistentView (const PipelineViewTag &viewId, ViewPtr view)
 
void AddTransientView (const PipelineViewTag &viewId, ViewPtr view)
 
void SetDefaultView (ViewPtr view)
 
void SetDefaultStereoscopicViewFromEntity (EntityId entityId, RPI::ViewType viewType)
 
ViewPtr GetDefaultView ()
 
ViewPtr GetFirstView (const PipelineViewTag &viewTag)
 
void SetDefaultViewFromEntity (EntityId entityId)
 Set default view from an entity which should have a ViewProvider handler.
 
bool HasViewTag (const PipelineViewTag &viewTag) const
 Check if this pipeline has the specified PipelineViewTag.
 
const PipelineViewTag & GetMainViewTag () const
 Get the main view tag (the tag used for the default view).
 
const AZStd::vector< ViewPtr > & GetViews (const PipelineViewTag &viewTag) const
 Get views that are associated with specified view tag.
 
const RHI::DrawListMask & GetDrawListMask (const PipelineViewTag &viewTag) const
 Get the draw list mask that are associated with specified view tag.
 
const PipelineViewMap & GetPipelineViews () const
 Get this render pipeline's view information.
 
bool NeedsRender () const
 Check whether this pipeline needs to be rendered in next tick.
 
RenderPipelineId GetId () const
 
const Ptr< ParentPass > & GetRootPass () const
 
u32 GetPipelinePassChanges () const
 Returns the flags indicating the pipeline pass changes that occured this past frame.
 
void ProcessQueuedPassChanges ()
 Processes passes in the pipeline that are queued for build, initialization or removal.
 
void MarkPipelinePassChanges (u32 passChangeFlags)
 This function signals the render pipeline that modifications have been made to the pipeline passes.
 
void UpdatePasses ()
 Update passes and views that are affected by any modifed passes. Called at the start of each frame.
 
bool IsExecuteOnce ()
 Check if this pipeline should be removed after a single execution.
 
void RemoveFromScene ()
 
SceneGetScene () const
 
AzFramework::NativeWindowHandle GetWindowHandle () const
 return the window handle associated with this render pipeline if it's created for window
 
PipelineRenderSettingsGetRenderSettings ()
 Return the render settings that can be queried by passes to setup things like render target resolution.
 
const PipelineRenderSettingsGetRenderSettings () const
 
void RevertRenderSettings ()
 Undoes runtime changes made to active render settings by reverting to original settings from the descriptor.
 
void AddToRenderTickOnce ()
 
void AddToRenderTick ()
 
void RemoveFromRenderTick ()
 Disable render for this RenderPipeline.
 
RenderMode GetRenderMode () const
 Get current render mode.
 
RHI::DrawFilterMask GetDrawFilterMask () const
 Get draw filter mask.
 
const RenderPipelineDescriptorGetDescriptor () const
 Get the RenderPipelineDescriptor which was used to create this RenderPipeline.
 
bool AddPassBefore (Ptr< Pass > newPass, const AZ::Name &referencePassName)
 
bool AddPassAfter (Ptr< Pass > newPass, const AZ::Name &referencePassName)
 
Ptr< PassFindFirstPass (const AZ::Name &passName)
 
ViewType GetViewType () const
 Return the view type associated with this pipeline.
 
void UpdateViewportScissor ()
 Update viewport and scissor based on pass tree's output.
 

Static Public Member Functions

static RenderPipelinePtr CreateRenderPipeline (const RenderPipelineDescriptor &desc)
 
static RenderPipelinePtr CreateRenderPipelineFromAsset (Data::Asset< AnyAsset > pipelineAsset)
 
static RenderPipelinePtr CreateRenderPipelineForWindow (const RenderPipelineDescriptor &desc, const WindowContext &windowContext, const ViewType viewType=ViewType::Default)
 
static RenderPipelinePtr CreateRenderPipelineForWindow (Data::Asset< AnyAsset > pipelineAsset, const WindowContext &windowContext)
 
static RenderPipelinePtr CreateRenderPipelineForImage (const RenderPipelineDescriptor &desc, Data::Asset< AttachmentImageAsset > imageAsset)
 

Friends

class Pass
 
class PassSystem
 
class Scene
 

Detailed Description

RenderPipeline describes how to render a scene. It has all the passes and views for rendering. A scene may have several pipelines. Each pipeline have its own render frequency. Pipeline can be disabled and it won't be rendered if it's disabled.

Member Function Documentation

◆ AddPassAfter()

bool AZ::RPI::RenderPipeline::AddPassAfter ( Ptr< Pass newPass,
const AZ::Name &  referencePassName 
)

Find a reference pass's location and add the new pass after the reference pass After the new pass was inserted, the new pass and the reference pass are siblings

◆ AddPassBefore()

bool AZ::RPI::RenderPipeline::AddPassBefore ( Ptr< Pass newPass,
const AZ::Name &  referencePassName 
)

Find a reference pass's location and add the new pass before the reference pass After the new pass was inserted, the new pass and the reference pass are siblings

◆ AddToRenderTick()

void AZ::RPI::RenderPipeline::AddToRenderTick ( )

Add this RenderPipeline to RPI system's RenderTick and it will be rendered whenever the RPI system's RenderTick is called. The RenderPipeline is rendered per RenderTick by default unless AddToRenderTickOnce() was called.

◆ AddToRenderTickOnce()

void AZ::RPI::RenderPipeline::AddToRenderTickOnce ( )

Add this RenderPipeline to the next RPI system's RenderTick and it will be rendered once. This function can be used for render a render pipeline with desired frequency as its associated window/view is expecting. Note: the RenderPipeline will be only rendered once if this function is called multiple time between two system ticks.

◆ AddTransientView()

void AZ::RPI::RenderPipeline::AddTransientView ( const PipelineViewTag &  viewId,
ViewPtr  view 
)

Add a view for a PipelineViewTag used in this pipeline. The view's reference will be only saved for rendering one frame and it will be cleared when the next frame starts. This function should be used after OnStartFrame is called.

◆ CreateRenderPipelineForImage()

static RenderPipelinePtr AZ::RPI::RenderPipeline::CreateRenderPipelineForImage ( const RenderPipelineDescriptor desc,
Data::Asset< AttachmentImageAsset imageAsset 
)
static

Create a render pipeline which renders to the specified attachment image The render pipeline's root pass is created from the pass template specified from RenderPipelineDescriptor::m_rootPassTemplate The input AttachmentImageAsset is used to connect to first output attachment of the root pass template Note: the AttachmentImageAsset doesn't need to be loaded

◆ FindFirstPass()

Ptr< Pass > AZ::RPI::RenderPipeline::FindFirstPass ( const AZ::Name &  passName)

Find the first pass with matching name in the render pipeline Note: to find all the passes with matching name in this render pipeline, use RPI::PassSystemInterface::Get()->ForEachPass() function instead.

◆ GetDefaultView()

ViewPtr AZ::RPI::RenderPipeline::GetDefaultView ( )

Get the view for the default view tag. It's the same as GetViews(GetMainViewTag()) and using first element.

◆ GetFirstView()

ViewPtr AZ::RPI::RenderPipeline::GetFirstView ( const PipelineViewTag &  viewTag)

Get the frist view for the view tag. It's the same as GetViews("tag") and using first element.

◆ SetDefaultStereoscopicViewFromEntity()

void AZ::RPI::RenderPipeline::SetDefaultStereoscopicViewFromEntity ( EntityId  entityId,
RPI::ViewType  viewType 
)

Set a stereoscopic view to the default view tag. It's the same as SetPersistentView(GetMainViewTag(), view)

◆ SetDefaultView()

void AZ::RPI::RenderPipeline::SetDefaultView ( ViewPtr  view)

Set a view to the default view tag. It's the same as SetPersistentView(GetMainViewTag(), view)

◆ SetPersistentView()

void AZ::RPI::RenderPipeline::SetPersistentView ( const PipelineViewTag &  viewId,
ViewPtr  view 
)

Assign a view for a PipelineViewTag used in this pipeline. This reference of this view will be saved until it's replaced in another SetPersistentView call.


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