![]() |
Lysa
0.0
Lysa 3D Engine
|
High-level scene renderer orchestrating the frame graph.
Notes:
Inheritance diagram for Renderer:Classes | |
| struct | BlurData |
| struct | FrameData |
Public Member Functions | |
| Renderer (const RenderingConfiguration &config, bool withStencil, const std::string &name) | |
| virtual void | resize (const vireo::Extent &extent, const std::shared_ptr< vireo::CommandList > &commandList) |
| std::shared_ptr< vireo::RenderTarget > | getColorAttachment (uint32 frameIndex) const |
| auto | getColorRenderTarget (const uint32 frameIndex) const |
| auto | getDepthRenderTarget (const uint32 frameIndex) const |
| virtual std::shared_ptr< vireo::RenderTarget > | getBloomColorAttachment (uint32 frameIndex) const = 0 |
| void | updatePipelines (const Scene &scene) |
| virtual void | updatePipelines (const std::unordered_map< pipeline_id, std::vector< std::shared_ptr< Material >>> &pipelineIds) |
| virtual void | update (uint32 frameIndex) |
| void | compute (vireo::CommandList &commandList, Scene &scene, uint32 frameIndex) const |
| void | preRender (vireo::CommandList &commandList, const Scene &scene, uint32 frameIndex) |
| void | render (vireo::CommandList &commandList, const Scene &scene, bool clearAttachment, uint32 frameIndex) |
| void | postprocess (vireo::CommandList &commandList, const vireo::Viewport &viewport, const vireo::Rect &scissor, uint32 frameIndex) |
| void | addPostprocessing (const std::string &fragShaderName, vireo::ImageFormat outputFormat, void *data=nullptr, uint32 dataSize=0) |
| void | removePostprocessing (const std::string &fragShaderName) |
| virtual | ~Renderer () = default |
| Renderer (Renderer &) = delete | |
| Renderer & | operator= (Renderer &) = delete |
Protected Member Functions | |
| virtual void | colorPass (vireo::CommandList &commandList, const Scene &scene, const std::shared_ptr< vireo::RenderTarget > &colorAttachment, const std::shared_ptr< vireo::RenderTarget > &depthAttachment, bool clearAttachment, uint32 frameIndex) = 0 |
| void | updateBlurData (BlurData &blurData, const vireo::Extent &extent, float strength) const |
Protected Attributes | |
| const RenderingConfiguration & | config |
| const std::string | name |
| const bool | withStencil |
| Renderer | ( | const RenderingConfiguration & | config, |
| bool | withStencil, | ||
| const std::string & | name | ||
| ) |
Constructs a renderer with the given configuration.
| config | Global rendering configuration (formats, buffering). |
| withStencil | True when depth buffers include a stencil component. |
| name | Human-readable renderer name (for debugging). |
|
virtualdefault |
|
delete |
| void addPostprocessing | ( | const std::string & | fragShaderName, |
| vireo::ImageFormat | outputFormat, | ||
| void * | data = nullptr, |
||
| uint32 | dataSize = 0 |
||
| ) |
Adds a full-screen post-processing pass by fragment shader name.
|
protectedpure virtual |
Records the pipeline-specific color pass for the concrete renderer. Implementations dispatch scene draws into colorAttachment/depthAttachment.
Implemented in lysa::DeferredRenderer::colorPass(), lysa::ForwardRenderer::colorPass()
Executes compute workloads such as frustum culling.
|
pure virtual |
Returns the color buffer used for bloom extraction for the frame. Concrete renderers decide which buffer carries the bright pass.
Implemented in lysa::DeferredRenderer::getBloomColorAttachment(), lysa::ForwardRenderer::getBloomColorAttachment()
| std::shared_ptr<vireo::RenderTarget> getColorAttachment | ( | uint32 | frameIndex | ) | const |
Returns the color attachment of the current renderer for the frame.
|
inline |
Short-hand accessor for the color render target of the frame.
|
inline |
Short-hand accessor for the depth render target of the frame.
|
delete |
| void postprocess | ( | vireo::CommandList & | commandList, |
| const vireo::Viewport & | viewport, | ||
| const vireo::Rect & | scissor, | ||
| uint32 | frameIndex | ||
| ) |
Applies post-processing chain (SMAA, bloom, custom passes).
Pre-render stage: uploads, layout transitions, and shadow maps.
| void removePostprocessing | ( | const std::string & | fragShaderName | ) |
Removes a previously added post-processing pass by fragment name.
| void render | ( | vireo::CommandList & | commandList, |
| const Scene & | scene, | ||
| bool | clearAttachment, | ||
| uint32 | frameIndex | ||
| ) |
Main render stage: records opaque/transparent draw calls.
|
virtual |
Recreates attachments/pipelines after a resize.
| extent | New swap chain extent. |
| commandList | Command list used for any required transitions/copies. |
Reimplemented in lysa::DeferredRenderer::resize(), lysa::ForwardRenderer::resize()
|
virtual |
Performs per-frame housekeeping (e.g., pass-local data updates).
Reimplemented in lysa::ForwardRenderer::update(), lysa::DeferredRenderer::update()
|
protected |
Precomputes Gaussian weights and texel size based on extent/strength.
| void updatePipelines | ( | const Scene & | scene | ) |
|
virtual |
Updates graphics pipelines according to the provided materials mapping.
| pipelineIds | Map of pipeline family id to materials. |
Reimplemented in lysa::DeferredRenderer::updatePipelines(), lysa::ForwardRenderer::updatePipelines()
|
protected |
| float exposure |
| float gamma |
|
protected |
| float reduceMin {1.0f / 128.0f} |
| float reduceMul {1.0f / 8.0f} |
| float spanMax {8.0f} |
|
protected |