Skip to main content

SceneMemberRenderContextExtractionSystem Class Template

System that extracts per-member render contexts for active viewports. More...

Declaration

template <typename TOwnerHandle, typename TMemberHandle, typename TCullingStrategy, typename TCommandBuffer = NullCommandBuffer> class helios::engine::scene::systems::SceneMemberRenderContextExtractionSystem<TOwnerHandle, TMemberHandle, TCullingStrategy, TCommandBuffer> { ... }

Public Member Typedefs Index

template < ... >
usingEngineRoleTag = helios::engine::runtime::world::tags::SystemRole

Runtime role tag used for engine system registration. More...

template < ... >
usingCommandBuffer_type = TCommandBuffer

Command buffer type used by this extraction system. More...

Public Constructors Index

template < ... >
SceneMemberRenderContextExtractionSystem (TCullingStrategy cullingStrategy=TCullingStrategy())

Constructs the system with a culling strategy instance. More...

Public Member Functions Index

template < ... >
voidupdate (helios::engine::runtime::world::UpdateContext &updateContext, TCommandBuffer &cmdBuffer) noexcept

Extracts render commands for active viewports. More...

Private Member Attributes Index

template < ... >
TCullingStrategycullingStrategy_

Private Static Attributes Index

template < ... >
static auto &logger_ = helios::engine::util::log::LogManager::loggerForScope(HELIOS_LOG_SCOPE)

Description

System that extracts per-member render contexts for active viewports.

For each active viewport binding, the system resolves the bound scene and camera, evaluates the configured culling strategy for scene members, and writes accepted members as RenderCommands into the target command buffer.

Template Parameters
TOwnerHandle

Viewport entity handle type.

TMemberHandle

Scene member handle type.

TCullingStrategy

Frustum-culling strategy type.

TCommandBuffer

Command buffer used for extracted render commands.

Definition at line 76 of file SceneMemberRenderContextExtractionSystem.ixx.

Public Member Typedefs

CommandBuffer_type

template <typename TOwnerHandle, typename TMemberHandle, typename TCullingStrategy, typename TCommandBuffer = NullCommandBuffer>
using helios::engine::scene::systems::SceneMemberRenderContextExtractionSystem< TOwnerHandle, TMemberHandle, TCullingStrategy, TCommandBuffer >::CommandBuffer_type = TCommandBuffer

Command buffer type used by this extraction system.

Definition at line 88 of file SceneMemberRenderContextExtractionSystem.ixx.

EngineRoleTag

template <typename TOwnerHandle, typename TMemberHandle, typename TCullingStrategy, typename TCommandBuffer = NullCommandBuffer>
using helios::engine::scene::systems::SceneMemberRenderContextExtractionSystem< TOwnerHandle, TMemberHandle, TCullingStrategy, TCommandBuffer >::EngineRoleTag = helios::engine::runtime::world::tags::SystemRole

Runtime role tag used for engine system registration.

Definition at line 85 of file SceneMemberRenderContextExtractionSystem.ixx.

Public Constructors

SceneMemberRenderContextExtractionSystem()

template <typename TOwnerHandle, typename TMemberHandle, typename TCullingStrategy, typename TCommandBuffer = NullCommandBuffer>
helios::engine::scene::systems::SceneMemberRenderContextExtractionSystem< TOwnerHandle, TMemberHandle, TCullingStrategy, TCommandBuffer >::SceneMemberRenderContextExtractionSystem (TCullingStrategy cullingStrategy=TCullingStrategy())
inline explicit

Constructs the system with a culling strategy instance.

Parameters
cullingStrategy

Strategy used to decide whether a scene member should produce render work.

Definition at line 96 of file SceneMemberRenderContextExtractionSystem.ixx.

Public Member Functions

update()

template <typename TOwnerHandle, typename TMemberHandle, typename TCullingStrategy, typename TCommandBuffer = NullCommandBuffer>
void helios::engine::scene::systems::SceneMemberRenderContextExtractionSystem< TOwnerHandle, TMemberHandle, TCullingStrategy, TCommandBuffer >::update (helios::engine::runtime::world::UpdateContext & updateContext, TCommandBuffer & cmdBuffer)
inline noexcept

Extracts render commands for active viewports.

Parameters
updateContext

Current frame update context.

cmdBuffer

Command buffer receiving extracted render commands.

Definition at line 105 of file SceneMemberRenderContextExtractionSystem.ixx.

106
107
114 >().whereEnabled()) {
115
116 const auto sceneHandle = sbc->targetHandle();
117 const auto cameraHandle = cbc->targetHandle();
118
120 if (!camera) {
121 assert(false && "Camera not found");
122 logger_.error("Camera not found");
123 continue;
124 }
126 if (!pcc) {
127 assert(pcc && "Camera had no ProjectionMatrixComponent");
128 logger_.error("Camera had no ProjectionMatrixComponent");
129 continue;
130 }
132 if (!lac) {
133 assert(lac && "Camera had no ViewMatrixComponent");
134 logger_.error("Camera had no ViewMatrixComponent");
135 continue;
136 }
137
138 for (auto [
140 smc,
141 rpc,
142 wmc,
143 wbc,
145 ] : updateContext.view<
152 >().whereEnabled()) {
153
154 if (smc->targetHandle() == sceneHandle && cullingStrategy_.shouldRender(
155 CullingContext{pcc->value(), lac->value(), wbc->value(), memberEntity.handle()}
156 )
157 ) {
158
161 memberEntity.handle(),
162 fbc->targetHandle(),
163 viewportEntity.handle(),
164 sceneHandle,
165 rpc->meshHandle(),
166 rpc->materialHandle(),
167 rpc->shaderHandle(),
168 wmc->value()
169 });
170
171
172 }
173 }
174 }
175
176 }

References helios::engine::scene::types::CullingContext< TMemberHandle >::handle, helios::engine::scene::types::SceneMemberRenderContext< TMemberHandle >::meshHandle and helios::engine::scene::registerComponents.

Private Member Attributes

cullingStrategy_

template <typename TOwnerHandle, typename TMemberHandle, typename TCullingStrategy, typename TCommandBuffer = NullCommandBuffer>
TCullingStrategy helios::engine::scene::systems::SceneMemberRenderContextExtractionSystem< TOwnerHandle, TMemberHandle, TCullingStrategy, TCommandBuffer >::cullingStrategy_

Definition at line 78 of file SceneMemberRenderContextExtractionSystem.ixx.

78 TCullingStrategy cullingStrategy_;

Private Static Attributes

logger_

template <typename TOwnerHandle, typename TMemberHandle, typename TCullingStrategy, typename TCommandBuffer = NullCommandBuffer>
auto& helios::engine::scene::systems::SceneMemberRenderContextExtractionSystem< TOwnerHandle, TMemberHandle, TCullingStrategy, TCommandBuffer >::logger_ = helios::engine::util::log::LogManager::loggerForScope(HELIOS_LOG_SCOPE)
static

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.