Open 3D Engine LyShine 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.
LyShine::RenderGraph Class Reference

Inherits LyShine::IRenderGraph.

Classes

struct  DynamicQuad
 

Public Member Functions

void ResetGraph ()
 Free up all the memory and clear the lists.
 
void BeginMask (bool isMaskingEnabled, bool useAlphaTest, bool drawBehind, bool drawInFront) override
 Begin the setup of a mask render node, primitives added between this call and StartChildrenForMask define the mask.
 
void StartChildrenForMask () override
 Start defining the children (masked primitives) of a mask.
 
void EndMask () override
 End the setup of a mask render node, this marks the end of adding child primitives.
 
void BeginRenderToTexture (AZ::Data::Instance< AZ::RPI::AttachmentImage > attachmentImage, const AZ::Vector2 &viewportTopLeft, const AZ::Vector2 &viewportSize, const AZ::Color &clearColor) override
 Begin rendering to a texture.
 
void EndRenderToTexture () override
 End rendering to a texture.
 
LyShine::UiPrimitiveGetDynamicQuadPrimitive (const AZ::Vector2 *positions, uint32 packedColor) override
 
bool IsRenderingToMask () const override
 Get flag that indicates we are rendering into a mask. Used to avoid masks on child mask elements.
 
void SetIsRenderingToMask (bool isRenderingToMask) override
 Set flag that we are rendering into a mask. Used to avoid masks on child mask elements.
 
void PushAlphaFade (float alphaFadeValue) override
 Push an alpha fade, this is multiplied with any existing alpha fade from parents.
 
void PushOverrideAlphaFade (float alphaFadeValue) override
 Push a new alpha fade value, this replaces any existing alpha fade.
 
void PopAlphaFade () override
 Pop an alpha fade off the stack.
 
float GetAlphaFade () const override
 Get the current alpha fade value.
 
void AddPrimitive (LyShine::UiPrimitive *primitive, const AZ::Data::Instance< AZ::RPI::Image > &texture, bool isClampTextureMode, bool isTextureSRGB, bool isTexturePremultipliedAlpha, BlendMode blendMode) override
 Add an indexed triangle list primitive to the render graph with given render state.
 
void AddAlphaMaskPrimitive (LyShine::UiPrimitive *primitive, AZ::Data::Instance< AZ::RPI::AttachmentImage > contentAttachmentImage, AZ::Data::Instance< AZ::RPI::AttachmentImage > maskAttachmentImage, bool isClampTextureMode, bool isTextureSRGB, bool isTexturePremultipliedAlpha, BlendMode blendMode) override
 Add an indexed triangle list primitive to the render graph which will use maskTexture as an alpha (gradient) mask.
 
void Render (UiRenderer *uiRenderer, const AZ::Vector2 &viewportSize)
 Render the display graph.
 
void SetDirtyFlag (bool isDirty)
 Set the dirty flag - this also resets the graph.
 
bool GetDirtyFlag ()
 Get the dirty flag.
 
void FinalizeGraph ()
 End the building of the graph.
 
bool IsEmpty ()
 Test whether the render graph contains any render nodes.
 
void GetRenderTargetsAndDependencies (LyShine::AttachmentImagesAndDependencies &attachmentImagesAndDependencies)
 
void ValidateGraph ()
 
void GetDebugInfoRenderGraph (LyShineDebug::DebugInfoRenderGraph &info) const
 
void GetDebugInfoRenderNodeList (const AZStd::vector< RenderNode * > &renderNodeList, LyShineDebug::DebugInfoRenderGraph &info, AZStd::set< AZ::Data::Instance< AZ::RPI::Image > > &uniqueTextures) const
 
void DebugReportDrawCalls (AZ::IO::HandleType fileHandle, LyShineDebug::DebugInfoDrawCallReport &reportInfo, void *context) const
 
void DebugReportDrawCallsRenderNodeList (const AZStd::vector< RenderNode * > &renderNodeList, AZ::IO::HandleType fileHandle, LyShineDebug::DebugInfoDrawCallReport &reportInfo, void *context, const AZStd::string &indent) const
 
- Public Member Functions inherited from LyShine::IRenderGraph
virtual ~IRenderGraph ()
 Virtual destructor.
 
virtual void BeginMask (bool isMaskingEnabled, bool useAlphaTest, bool drawBehind, bool drawInFront)=0
 Begin the setup of a mask render node, primitives added between this call and StartChildrenForMask define the mask.
 
virtual void StartChildrenForMask ()=0
 Start defining the children (masked primitives) of a mask.
 
virtual void EndMask ()=0
 End the setup of a mask render node, this marks the end of adding child primitives.
 
virtual void BeginRenderToTexture (AZ::Data::Instance< AZ::RPI::AttachmentImage > attachmentImage, const AZ::Vector2 &viewportTopLeft, const AZ::Vector2 &viewportSize, const AZ::Color &clearColor)=0
 Begin rendering to a texture.
 
virtual void EndRenderToTexture ()=0
 End rendering to a texture.
 
virtual void AddPrimitive (LyShine::UiPrimitive *primitive, const AZ::Data::Instance< AZ::RPI::Image > &texture, bool isClampTextureMode, bool isTextureSRGB, bool isTexturePremultipliedAlpha, BlendMode blendMode)=0
 Add an indexed triangle list primitive to the render graph with given render state.
 
virtual void AddAlphaMaskPrimitive (LyShine::UiPrimitive *primitive, AZ::Data::Instance< AZ::RPI::AttachmentImage > contentAttachmentImage, AZ::Data::Instance< AZ::RPI::AttachmentImage > maskAttachmentImage, bool isClampTextureMode, bool isTextureSRGB, bool isTexturePremultipliedAlpha, BlendMode blendMode)=0
 Add an indexed triangle list primitive to the render graph which will use maskTexture as an alpha (gradient) mask.
 
virtual LyShine::UiPrimitiveGetDynamicQuadPrimitive (const AZ::Vector2 *positions, uint32 packedColor)=0
 
virtual bool IsRenderingToMask () const =0
 Get flag that indicates we are rendering into a mask. Used to avoid masks on child mask elements.
 
virtual void SetIsRenderingToMask (bool isRenderingToMask)=0
 Set flag that we are rendering into a mask. Used to avoid masks on child mask elements.
 
virtual void PushAlphaFade (float alphaFadeValue)=0
 Push an alpha fade, this is multiplied with any existing alpha fade from parents.
 
virtual void PushOverrideAlphaFade (float alphaFadeValue)=0
 Push a new alpha fade value, this replaces any existing alpha fade.
 
virtual void PopAlphaFade ()=0
 Pop an alpha fade off the stack.
 
virtual float GetAlphaFade () const =0
 Get the current alpha fade value.
 

Protected Member Functions

AZ::RHI::TargetBlendState GetBlendModeState (LyShine::BlendMode blendMode, bool isShaderOutputPremultAlpha) const
 Given a blend mode and whether the shader will be outputing premultiplied alpha, return state flags.
 
void SetRttPassesEnabled (UiRenderer *uiRenderer, bool enabled)
 

Protected Attributes

AZStd::vector< RenderNode * > m_renderNodes
 
AZStd::vector< DynamicQuad * > m_dynamicQuads
 
MaskRenderNodem_currentMask = nullptr
 
RenderTargetRenderNodem_currentRenderTarget = nullptr
 
AZStd::stack< AZStd::vector< RenderNode * > * > m_renderNodeListStack
 
bool m_isDirty = true
 
int m_renderToRenderTargetCount = 0
 
bool m_isRenderingToMask = false
 
AZStd::stack< float > m_alphaFadeStack
 
AZStd::vector< RenderTargetRenderNode * > m_renderTargetRenderNodes
 
int m_renderTargetNestLevel = 0
 
bool m_wasBuiltThisFrame = false
 
AZ::u64 m_timeGraphLastBuiltMs = 0
 

Member Function Documentation

◆ AddAlphaMaskPrimitive()

void LyShine::RenderGraph::AddAlphaMaskPrimitive ( LyShine::UiPrimitive primitive,
AZ::Data::Instance< AZ::RPI::AttachmentImage >  contentAttachmentImage,
AZ::Data::Instance< AZ::RPI::AttachmentImage >  maskAttachmentImage,
bool  isClampTextureMode,
bool  isTextureSRGB,
bool  isTexturePremultipliedAlpha,
BlendMode  blendMode 
)
overridevirtual

Add an indexed triangle list primitive to the render graph which will use maskTexture as an alpha (gradient) mask.

Implements LyShine::IRenderGraph.

◆ AddPrimitive()

void LyShine::RenderGraph::AddPrimitive ( LyShine::UiPrimitive primitive,
const AZ::Data::Instance< AZ::RPI::Image > &  texture,
bool  isClampTextureMode,
bool  isTextureSRGB,
bool  isTexturePremultipliedAlpha,
BlendMode  blendMode 
)
overridevirtual

Add an indexed triangle list primitive to the render graph with given render state.

Implements LyShine::IRenderGraph.

◆ BeginMask()

void LyShine::RenderGraph::BeginMask ( bool  isMaskingEnabled,
bool  useAlphaTest,
bool  drawBehind,
bool  drawInFront 
)
overridevirtual

Begin the setup of a mask render node, primitives added between this call and StartChildrenForMask define the mask.

Implements LyShine::IRenderGraph.

◆ BeginRenderToTexture()

void LyShine::RenderGraph::BeginRenderToTexture ( AZ::Data::Instance< AZ::RPI::AttachmentImage >  attachmentImage,
const AZ::Vector2 &  viewportTopLeft,
const AZ::Vector2 &  viewportSize,
const AZ::Color &  clearColor 
)
overridevirtual

Begin rendering to a texture.

Implements LyShine::IRenderGraph.

◆ EndMask()

void LyShine::RenderGraph::EndMask ( )
overridevirtual

End the setup of a mask render node, this marks the end of adding child primitives.

Implements LyShine::IRenderGraph.

◆ EndRenderToTexture()

void LyShine::RenderGraph::EndRenderToTexture ( )
overridevirtual

End rendering to a texture.

Implements LyShine::IRenderGraph.

◆ GetAlphaFade()

float LyShine::RenderGraph::GetAlphaFade ( ) const
overridevirtual

Get the current alpha fade value.

Implements LyShine::IRenderGraph.

◆ GetDynamicQuadPrimitive()

LyShine::UiPrimitive * LyShine::RenderGraph::GetDynamicQuadPrimitive ( const AZ::Vector2 *  positions,
uint32  packedColor 
)
overridevirtual

Get a dynamic quad primitive that can be added as an image primitive to the render graph The graph handles the allocation of this DynUiPrimitive and deletes it when the graph is reset This can be used if the UI component doesn't want to own the storage of the primitive. Used infrequently, e.g. for the selection rect on a text component.

Implements LyShine::IRenderGraph.

◆ IsRenderingToMask()

bool LyShine::RenderGraph::IsRenderingToMask ( ) const
overridevirtual

Get flag that indicates we are rendering into a mask. Used to avoid masks on child mask elements.

Implements LyShine::IRenderGraph.

◆ PopAlphaFade()

void LyShine::RenderGraph::PopAlphaFade ( )
overridevirtual

Pop an alpha fade off the stack.

Implements LyShine::IRenderGraph.

◆ PushAlphaFade()

void LyShine::RenderGraph::PushAlphaFade ( float  alphaFadeValue)
overridevirtual

Push an alpha fade, this is multiplied with any existing alpha fade from parents.

Implements LyShine::IRenderGraph.

◆ PushOverrideAlphaFade()

void LyShine::RenderGraph::PushOverrideAlphaFade ( float  alphaFadeValue)
overridevirtual

Push a new alpha fade value, this replaces any existing alpha fade.

Implements LyShine::IRenderGraph.

◆ SetIsRenderingToMask()

void LyShine::RenderGraph::SetIsRenderingToMask ( bool  isRenderingToMask)
overridevirtual

Set flag that we are rendering into a mask. Used to avoid masks on child mask elements.

Implements LyShine::IRenderGraph.

◆ StartChildrenForMask()

void LyShine::RenderGraph::StartChildrenForMask ( )
overridevirtual

Start defining the children (masked primitives) of a mask.

Implements LyShine::IRenderGraph.


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