Lysa  0.0
Lysa 3D Engine
GBufferPass Class Reference

Detailed Description

Render pass for generating G-buffers

+ Inheritance diagram for GBufferPass:

Public Member Functions

 GBufferPass (const RendererConfiguration &config, bool withStencil)
 
void updatePipelines (const std::unordered_map< pipeline_id, std::vector< unique_id >> &pipelineIds)
 
void render (vireo::CommandList &commandList, const SceneFrameData &scene, const std::shared_ptr< vireo::RenderTarget > &colorAttachment, const std::shared_ptr< vireo::RenderTarget > &depthAttachment, bool clearAttachment, uint32 frameIndex)
 
void resize (const vireo::Extent &extent, const std::shared_ptr< vireo::CommandList > &commandList) override
 
auto getPositionBuffer (const uint32 frameIndex) const
 
auto getNormalBuffer (const uint32 frameIndex) const
 
auto getAlbedoBuffer (const uint32 frameIndex) const
 
auto getEmissiveBuffer (const uint32 frameIndex) const
 
auto getVelocityBuffer (const uint32 frameIndex) const
 
- Public Member Functions inherited from Renderpass
 Renderpass (const RendererConfiguration &config, const std::string &name)
 
virtual void update (uint32 frameIndex)
 
virtual ~Renderpass () = default
 
 Renderpass (Renderpass &) = delete
 
Renderpass & operator= (Renderpass &) = delete
 

Additional Inherited Members

- Static Public Member Functions inherited from Renderpass
static void destroyShaderModules ()
 
- Protected Member Functions inherited from Renderpass
std::shared_ptr< vireo::ShaderModule > loadShader (const std::string &shaderName) const
 
void init (vireo::GraphicPipelineConfiguration &pipelineConfig, vireo::RenderingConfiguration &renderingConfig, const std::shared_ptr< vireo::DescriptorLayout > &descriptorLayout, bool withStencil)
 
void init (vireo::GraphicPipelineConfiguration &pipelineConfig, vireo::RenderingConfiguration &renderingConfig, bool withStencil) const
 
void initRendering (vireo::CommandList &commandList, const std::shared_ptr< vireo::Image > &image, const std::shared_ptr< vireo::GraphicPipeline > &pipeline, const std::shared_ptr< vireo::DescriptorSet > &sceneDescriptorSet, const std::shared_ptr< vireo::DescriptorSet > &descriptorSet)
 
- Protected Attributes inherited from Renderpass
const std::string name
 
const RendererConfigurationconfig
 
- Static Protected Attributes inherited from Renderpass
static std::mutex shaderModulesMutex
 
static std::unordered_map< std::string, std::shared_ptr< vireo::ShaderModule > > shaderModules
 

Constructor & Destructor Documentation

GBufferPass ( const RendererConfiguration config,
bool  withStencil 
)

Constructs a GBufferPass

Parameters
configThe renderer configuration
withStencilWhether to enable stencil testing

Member Function Documentation

auto getAlbedoBuffer ( const uint32  frameIndex) const
inline

Gets the albedo buffer for a specific frame

Parameters
frameIndexIndex of the current frame
Returns
A shared pointer to the albedo render target
auto getEmissiveBuffer ( const uint32  frameIndex) const
inline

Gets the emissive buffer for a specific frame

Parameters
frameIndexIndex of the current frame
Returns
A shared pointer to the emissive render target
auto getNormalBuffer ( const uint32  frameIndex) const
inline

Gets the normal buffer for a specific frame

Parameters
frameIndexIndex of the current frame
Returns
A shared pointer to the normal render target
auto getPositionBuffer ( const uint32  frameIndex) const
inline

Gets the position buffer for a specific frame

Parameters
frameIndexIndex of the current frame
Returns
A shared pointer to the position render target
auto getVelocityBuffer ( const uint32  frameIndex) const
inline

Gets the velocity buffer for a specific frame

Parameters
frameIndexIndex of the current frame
Returns
A shared pointer to the velocity render target
void render ( vireo::CommandList &  commandList,
const SceneFrameData scene,
const std::shared_ptr< vireo::RenderTarget > &  colorAttachment,
const std::shared_ptr< vireo::RenderTarget > &  depthAttachment,
bool  clearAttachment,
uint32  frameIndex 
)

Renders the G-buffer pass

Parameters
commandListThe command list to record rendering commands into
sceneThe scene frame data
colorAttachmentThe target color attachment
depthAttachmentThe target depth attachment
clearAttachmentWhether to clear the color attachment
frameIndexIndex of the current frame
void resize ( const vireo::Extent &  extent,
const std::shared_ptr< vireo::CommandList > &  commandList 
)
overridevirtual

Recreate pass resources after a resize (default: no-op).

Reimplemented from lysa::Renderpass::resize()

void updatePipelines ( const std::unordered_map< pipeline_id, std::vector< unique_id >> &  pipelineIds)

Updates the graphics pipelines based on active pipeline IDs

Parameters
pipelineIdsMap of pipeline IDs to unique object IDs