ezEngine Release 25.08
Loading...
Searching...
No Matches
ezLSAOPass Class Reference

#include <LSAOPass.h>

Inheritance diagram for ezLSAOPass:

Public Member Functions

virtual bool GetRenderTargetDescriptions (const ezView &view, const ezArrayPtr< ezGALTextureCreationDescription *const > inputs, ezArrayPtr< ezGALTextureCreationDescription > outputs) override
 For a given input pin configuration, provide the output configuration of this node. Outputs is already resized to the number of output pins.
 
virtual void InitRenderPipelinePass (const ezArrayPtr< ezRenderPipelinePassConnection *const > inputs, const ezArrayPtr< ezRenderPipelinePassConnection *const > outputs) override
 After GetRenderTargetDescriptions was called successfully for each pass, this function is called with the inputs and outputs for review. Disconnected pins have a nullptr value in the passed in arrays. This is the time to create additional resources that are not covered by the pins automatically, e.g. a picking texture or eye adaptation buffer.
 
virtual void Execute (const ezRenderViewContext &renderViewContext, const ezArrayPtr< ezRenderPipelinePassConnection *const > inputs, const ezArrayPtr< ezRenderPipelinePassConnection *const > outputs) override
 Render into outputs. Both inputs and outputs are passed in with actual texture handles. Disconnected pins have a nullptr value in the passed in arrays. You can now create views and render target setups on the fly and fill the output targets with data.
 
virtual void ExecuteInactive (const ezRenderViewContext &renderViewContext, const ezArrayPtr< ezRenderPipelinePassConnection *const > inputs, const ezArrayPtr< ezRenderPipelinePassConnection *const > outputs) override
 
virtual ezResult Serialize (ezStreamWriter &inout_stream) const override
 
virtual ezResult Deserialize (ezStreamReader &inout_stream) override
 
ezUInt32 GetLineToLinePixelOffset () const
 
void SetLineToLinePixelOffset (ezUInt32 uiPixelOffset)
 
ezUInt32 GetLineSamplePixelOffset () const
 
void SetLineSamplePixelOffset (ezUInt32 uiPixelOffset)
 
float GetDepthCutoffDistance () const
 
void SetDepthCutoffDistance (float fDepthCutoffDistance)
 
float GetOcclusionFalloff () const
 
void SetOcclusionFalloff (float fFalloff)
 
- Public Member Functions inherited from ezRenderPipelinePass
 ezRenderPipelinePass (const char *szName, bool bIsStereoAware=false)
 
void SetName (const char *szName)
 Sets the name of the pass.
 
const char * GetName () const
 returns the name of the pass.
 
bool IsStereoAware () const
 True if the render pipeline pass can handle stereo cameras correctly.
 
virtual ezGALTextureHandle QueryTextureProvider (const ezRenderPipelineNodePin *pPin, const ezGALTextureCreationDescription &desc)
 
virtual void ReadBackProperties (ezView *pView)
 Allows for the pass to write data back using ezView::SetRenderPassReadBackProperty. E.g. picking results etc.
 
void RenderDataWithCategory (const ezRenderViewContext &renderViewContext, ezRenderData::Category category)
 
EZ_ALWAYS_INLINE ezRenderPipelineGetPipeline ()
 
EZ_ALWAYS_INLINE const ezRenderPipelineGetPipeline () const
 
- Public Member Functions inherited from ezRenderPipelineNode
void InitializePins ()
 
ezHashedString GetPinName (const ezRenderPipelineNodePin *pPin) const
 
const ezRenderPipelineNodePinGetPinByName (const char *szName) const
 
const ezRenderPipelineNodePinGetPinByName (ezHashedString sName) const
 
const ezArrayPtr< const ezRenderPipelineNodePin *const > GetInputPins () const
 
const ezArrayPtr< const ezRenderPipelineNodePin *const > GetOutputPins () const
 
- Public Member Functions inherited from ezReflectedClass
virtual const ezRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const ezRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
EZ_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 

Protected Member Functions

void DestroyLineSweepData ()
 Destroys all GPU data that might have been created in in SetupLineSweepData.
 
void SetupLineSweepData (const ezVec3I32 &imageResolution)
 
void AddLinesForDirection (const ezVec3I32 &imageResolution, const ezVec2I32 &sampleDir, ezUInt32 lineIndex, ezDynamicArray< LineInstruction > &outinLineInstructions, ezUInt32 &outinTotalNumberOfSamples)
 

Protected Attributes

ezRenderPipelineNodeInputPin m_PinDepthInput
 
ezRenderPipelineNodeOutputPin m_PinOutput
 
ezConstantBufferStorageHandle m_hLineSweepCB
 
bool m_bSweepDataDirty = true
 
bool m_bConstantsDirty = true
 
ezGALBufferHandle m_hLineSweepOutputBuffer
 Output of the line sweep pass.
 
ezGALBufferRange m_LineSweepOutputBufferRange
 
ezGALBufferHandle m_hLineInfoBuffer
 Structured buffer containing instructions for every single line to trace.
 
ezUInt32 m_uiNumSweepLines = 0
 Total number of lines to be traced.
 
ezInt32 m_iLineToLinePixelOffset = 2
 
ezInt32 m_iLineSamplePixelOffsetFactor = 1
 
float m_fOcclusionFalloff = 0.2f
 
float m_fDepthCutoffDistance = 4.0f
 
ezEnum< ezLSAODepthCompareFunctionm_DepthCompareFunction
 
bool m_bDistributedGathering = true
 
ezShaderResourceHandle m_hShaderLineSweep
 
ezShaderResourceHandle m_hShaderGather
 
ezShaderResourceHandle m_hShaderAverage
 

Additional Inherited Members

- Static Public Member Functions inherited from ezNoBase
static const ezRTTIGetStaticRTTI ()
 

Detailed Description

Screen space ambient occlusion using "line sweep ambient occlusion" by Ville Timonen

Resources: Use in Quantum Break: http://wili.cc/research/quantum_break/SIGGRAPH_2015_Remedy_Notes.pdf Presentation slides EGSR: http://wili.cc/research/lsao/EGSR13_LSAO.pdf Paper: http://wili.cc/research/lsao/lsao.pdf

There are a few adjustments and own ideas worked into this implementation. The biggest change probably is that pixels in the gather pass compute their target linesample arithmetically instead of relying on lookups.

Member Function Documentation

◆ Deserialize()

ezResult ezLSAOPass::Deserialize ( ezStreamReader inout_stream)
overridevirtual

Reimplemented from ezRenderPipelinePass.

◆ Execute()

void ezLSAOPass::Execute ( const ezRenderViewContext renderViewContext,
const ezArrayPtr< ezRenderPipelinePassConnection *const >  inputs,
const ezArrayPtr< ezRenderPipelinePassConnection *const >  outputs 
)
overridevirtual

Render into outputs. Both inputs and outputs are passed in with actual texture handles. Disconnected pins have a nullptr value in the passed in arrays. You can now create views and render target setups on the fly and fill the output targets with data.

Implements ezRenderPipelinePass.

◆ ExecuteInactive()

void ezLSAOPass::ExecuteInactive ( const ezRenderViewContext renderViewContext,
const ezArrayPtr< ezRenderPipelinePassConnection *const >  inputs,
const ezArrayPtr< ezRenderPipelinePassConnection *const >  outputs 
)
overridevirtual

Reimplemented from ezRenderPipelinePass.

◆ GetRenderTargetDescriptions()

bool ezLSAOPass::GetRenderTargetDescriptions ( const ezView view,
const ezArrayPtr< ezGALTextureCreationDescription *const >  inputs,
ezArrayPtr< ezGALTextureCreationDescription outputs 
)
overridevirtual

For a given input pin configuration, provide the output configuration of this node. Outputs is already resized to the number of output pins.

Implements ezRenderPipelinePass.

◆ InitRenderPipelinePass()

void ezLSAOPass::InitRenderPipelinePass ( const ezArrayPtr< ezRenderPipelinePassConnection *const >  inputs,
const ezArrayPtr< ezRenderPipelinePassConnection *const >  outputs 
)
overridevirtual

After GetRenderTargetDescriptions was called successfully for each pass, this function is called with the inputs and outputs for review. Disconnected pins have a nullptr value in the passed in arrays. This is the time to create additional resources that are not covered by the pins automatically, e.g. a picking texture or eye adaptation buffer.

Reimplemented from ezRenderPipelinePass.

◆ Serialize()

ezResult ezLSAOPass::Serialize ( ezStreamWriter inout_stream) const
overridevirtual

Reimplemented from ezRenderPipelinePass.


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