Open 3D Engine Atom Gem API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
AZ::RPI::RenderPipeline Class Reference

#include <RenderPipeline.h>

Public Types

enum  RenderMode : uint8_t { RenderEveryTick, RenderOnce, NoRender }
 
using PipelineViewMap = AZStd::map< PipelineViewTag, PipelineViews, AZNameSortAscending >
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (RenderPipeline, AZ::SystemAllocator, 0)
 
void SetPersistentView (const PipelineViewTag &viewId, ViewPtr view)
 
void AddTransientView (const PipelineViewTag &viewId, ViewPtr view)
 
void SetDefaultView (ViewPtr view)
 
ViewPtr GetDefaultView ()
 
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.
 
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
 
void SetPassModified ()
 This function need to be called by Pass class when any passes are added/removed in this pipeline's pass tree.
 
void SetPassNeedsRecreate ()
 Notifies the pipeline it needs to recreate passes. Typical use case is for pass asset hot reloading.
 
void OnPassModified ()
 
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::DrawFilterTag GetDrawFilterTag () const
 Get draw filter tag.
 
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)
 

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)
 
static RenderPipelinePtr CreateRenderPipelineForWindow (Data::Asset< AnyAsset > pipelineAsset, const WindowContext &windowContext)
 

Friends

class Pass
 
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 renderpipeline with desired frequence as its associated window/view is expecting. Note: the RenderPipeline will be only renderred 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.

◆ 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.

◆ OnPassModified()

void AZ::RPI::RenderPipeline::OnPassModified ( )

Update passes and views when any pass was modified which may affect pipeline views. This function is automatically called when frame starts. User may call it manually when they expect to get up to date view information after any pass changes.

◆ 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: