RenderPassFactory Class
A factory class for constructing `RenderPass` objects and populating their `RenderQueue`s based on a `helios::scene::Snapshot`. More...
Declaration
Public Member Functions Index
| RenderPass | buildRenderPass (const helios::scene::Snapshot &snapshot) const |
|
Builds a `RenderPass` from a given `helios::scene::Snapshot`. More... | |
| void | populateRenderQueue (const helios::scene::Snapshot &snapshot, helios::rendering::RenderQueue &renderQueue) const |
|
Populates an existing `RenderQueue` with `RenderCommand`s based on a `Snapshot`. More... | |
| std::unique_ptr< RenderCommand > | makeRenderCommand (const helios::scene::SnapshotItem &snapshotItem) const noexcept |
|
Creates a single `RenderCommand` from a `helios::scene::SnapshotItem`. More... | |
Protected Member Attributes Index
| const helios::util::log::Logger & | logger_ = ... |
|
The logger used with this RenderPassFactory. Defaults to HELIOS_LOG_SCOPE. More... | |
Public Static Functions Index
| static RenderPassFactory & | getInstance () |
|
Returns the singleton instance of `RenderPassFactory`. More... | |
Description
A factory class for constructing `RenderPass` objects and populating their `RenderQueue`s based on a `helios::scene::Snapshot`.
This class implements a singleton pattern. In the future, the conversion of high-level scene data (Snapshot/SnapshotItems) into lower-level rendering commands might be realized with strategies and/or separate factories.
Definition at line 35 of file RenderPassFactory.ixx.
Public Member Functions
buildRenderPass()
| nodiscard |
Builds a `RenderPass` from a given `helios::scene::Snapshot`.
This method orchestrates the creation of a `RenderQueue` and populates it with `RenderCommand`s derived from the `SnapshotItem`s within the snapshot. It also sets up frame-specific uniform values for the `RenderPass`.
- Parameters
-
snapshot A const ref to the snapshot containing the scene data for which the `RenderPass` is to be built.
- Returns
A fully constructed `RenderPass` object. The returned object owns the `RenderQueue` and the frame-specific `UniformValueMap`.
- See Also
::populateRenderQueue()
Definition at line 71 of file RenderPassFactory.ixx.
makeRenderCommand()
| nodiscard noexcept |
Creates a single `RenderCommand` from a `helios::scene::SnapshotItem`.
This method extracts necessary data from the `SnapshotItem` and bundles them into a `RenderCommand` object.
- Parameters
-
snapshotItem A const ref to the `SnapshotItem` from which to create the `RenderCommand`.
- Returns
A unique pointer to the newly created `RenderCommand`. Returns nullptr if the associated Renderable is no longer available, or if the shader is not available from the `Renderable`'s material, or if the mesh is no longer available.
- Todo
-
future versions might want to use a FactoryMethod in RenderCommand that takes a SnapshotItem and creates a RenderCommand from it (e.g. `RenderCommand::fromSnapshotItem()`); or a Factory `RenderCommandBuilder()` with fluent configuration `.withShader().withMesh().build();`
Definition at line 106 of file RenderPassFactory.ixx.
populateRenderQueue()
|
Populates an existing `RenderQueue` with `RenderCommand`s based on a `Snapshot`.
This method clears the specified `RenderQueue` before adding new `RenderCommand`s to it.
- Parameters
-
snapshot A const ref to the `Snapshot` providing scene data.
renderQueue A ref to the `RenderQueue` to be filled. This queue will be cleared before new commands are added.
- See Also
::makeRenderCommand()
Definition at line 84 of file RenderPassFactory.ixx.
Protected Member Attributes
logger_
| protected |
The logger used with this RenderPassFactory. Defaults to HELIOS_LOG_SCOPE.
- Initialiser
-
= helios::util::log::LogManager::getInstance().registerLogger( HELIOS_LOG_SCOPE )
- Todo
-
constructor injection
Definition at line 44 of file RenderPassFactory.ixx.
Public Static Functions
getInstance()
| static |
Returns the singleton instance of `RenderPassFactory`.
- Returns
A reference to the single `RenderPassFactory` instance.
Definition at line 54 of file RenderPassFactory.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.