RendererSteps class final
The RenderStepRegistry a Renderer fills: a plugin's own render steps,
and its passes placed at the engine's anchors.
What a plugin that draws is handed. Its install asks the host for
this type, host.registry<RendererSteps>(), and gets a view scoped to
the plugin: everything added through it is withdrawn when the plugin is
switched off, and ranked by the plugin's place in the install order. An
application without plugins uses Renderer.renderSteps directly.
const glow = RenderStep('acme.soft_glow', needs: {RenderStep.bloom});
void install(PluginHost host) {
host.registry<RendererSteps>()
..addStep(glow)
..addNode(SoftGlowNode(), at: RenderAnchor.afterBloom, step: glow);
}
The registry reaches the plugin host by being one of its registries:
EngineLoop(registries: [renderer.renderSteps], plugins: …).
Steps
addStep makes a RenderStep one of this renderer's, beside the thirty
built in: RenderSettings.without and only switch it (given added
as also), a step it needs takes it down when switched off, and
FrameResult.skipped reports it — see RenderStep.
Nodes
addNode places a RenderNode at a RenderAnchor — the node's own
RenderNode.defaultAnchor when none is named. The nodes at one anchor run
in this order: the application's; then each plugin's, in install order —
and after/before, naming other nodes at the same anchor, move them
within that. A name at another anchor, or nowhere, is ignored, as a loop
constraint naming an absent system is.
A plugin's own anchors
addAnchor adds a RenderAnchor.after — an anchor of a plugin's own,
standing right after an engine anchor or another added one — so the
plugin, and those built on it, place nodes relative to something that
does not move when an engine pass is renamed. A node at an anchor nobody
added is refused.
Contributors
addContributor adds a PassContributor: draws that go inside the engine's own passes — the scene's, the transparent half, the velocity and the depth pre-pass — as particles and splats do. Everything else is a node.
A node given a step runs only while the step is on: switched off, the
node is inactive, and the frame reports its pass as switched off.
Properties
-
added
→ List<
RenderStep> -
The steps added to this renderer, in the order they were added.
no setter
-
all
→ List<
RenderStep> -
Every step this renderer knows: the built-in ones, then added.
no setter
-
anchors
→ List<
RenderAnchor> -
Every anchor a node can be placed at here: the engine's, then the ones
added with addAnchor, in the order they were added.
no setter
-
companions
→ Iterable<
PluginRegistry> -
The registries that come with this one, so a plugin host handed
renderer.renderStepsfinds them too: the renderer's LightingModels, the one entrance a plugin's lighting model comes in by (host.registry<LightingModels>()), its LightTypes, its RenderHooks, its SceneBindings and its PipelineNodeKinds.no setter -
contributors
→ List<
PassContributor> -
The contributors added, in the order they draw.
no setter
- device → GraphicsDevice
-
The device of the renderer this registry belongs to — what a plugin
loads its own stages with,
device.loadShaders(bytes).no setter - hashCode → int
-
The hash code for this object.
no setterinherited
-
nodeNames
→ List<
String> -
Every node added, at every anchor, in the order the frame meets them.
no setter
-
provided
→ List<
RenderStep> -
The steps taken with provide, in the order they were taken.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
settings
→ List<
SettingsSlot< Object> > -
The settings slots added to this renderer, each once, in the order
they were first added — what a settings screen walks, and what a
level's
renderSettingssection is read against:no setter -
withdrawn
→ Set<
RenderStep> -
The steps whose provider was switched off, and which every frame of
this renderer draws without until one provides them again.
no setter
Methods
-
addAnchor(
RenderAnchor anchor) → Registration -
Makes
anchor, aRenderAnchor.after, one of this renderer's: nodes may be placed at it from now on, and run right after the nodes at the anchor it follows. -
addComputeStep(
ComputeStep computeStep, {RenderAnchor? at, RenderStep? step, List< String> after = const <String>[], List<String> before = const <String>[]}) → Registration -
Adds
computeStepas a node atat, as addNode does, and places it (ComputeStep.prepare) — the one call that puts a compute step in the frame.stepis the render step that switches it, as addNode's is. -
addContributor(
PassContributor contributor) → Registration -
Adds
contributor— draws that go inside the engine's own passes: the scene's, the transparent half, the velocity and the depth pre-pass — ordered by PassContributor.order and then by when they were added, until the result is cancelled; one added by a plugin goes when the plugin is uninstalled. -
addFieldUpload(
FieldUpload upload, {RenderAnchor? at, RenderStep? step, List< String> after = const <String>[], List<String> before = const <String>[]}) → Registration -
Adds
uploadas a node and places it (FieldUpload.place), as addComputeStep does for a compute step: the one call that puts a simulation's field in the frame.stepis the render step that switches it, as addNode's is. -
addMaterials(
ShaderLibrary library) → Registration -
Adds
libraryto the stages this renderer finds by name, ahead of everything it already had —P8— until the result is cancelled: how a plugin hands the renderer the stages of the lighting models it registers, and how an application adds a bundle of its own. -
addNode(
RenderNode node, {RenderAnchor? at, RenderStep? step, List< String> after = const <String>[], List<String> before = const <String>[]}) → Registration -
Places
nodeatat— the node's own RenderNode.defaultAnchor when left out — owned bystepwhen one is given. -
addSettings(
SettingsSlot< Object> slot) → Registration -
Makes
slotone of this renderer's settings, until the result is cancelled — whatRenderStepAddon.settingsdoes for each of its own. -
addStep(
RenderStep step) → Registration -
Makes
stepone of this renderer's steps. -
addWorkload(
ComputeWorkload workload, {RenderAnchor? at}) → Registration -
Puts
workloadin the frame, placed by the hardware layer's workload rule for the device this renderer draws on: the GPUs the frame has, then the workload's own host code where it has some, then the CPU device; workloadStep answers what it was told (WorkloadStep.binding, WorkloadStep.refusal) — since 1.0.0-rc.1. -
anchorNamed(
String name) → RenderAnchor? -
The anchor called
name— the engine's or an added one — or null. -
forPlugin(
PluginScope scope) → RendererSteps -
This registry as
scope's plugin sees it: everything registered through the result is tracked byscope, ranked by it, and checked against its manifest. Must return the same type the registry is looked up by. -
fromDocument(
PipelineDocument document) → Registration -
Applies
documentto this renderer (D44): adds its anchors, and makes and places each node of its own through the PipelineNodeKinds its kind names, at its anchor, under its step, after and before what it says. Every registration it made goes when the result is cancelled. -
named(
String name) → RenderStep? -
The step called
name, built in or added, or null. A built-in step's word from before thef3d.prefix (bloom,color grade) finds it too, as the files written then name it. -
nodesAt(
RenderAnchor anchor) → List< String> -
The names of the nodes added at
anchor, in the order they will be registered there. For a test, or an inspector, that wants to see where a node went without compiling a frame. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
provide(
RenderStep step) → Registration -
Takes
stepas the caller's own: the plugin providing it is its switch. -
providerOf(
RenderStep step) → String? -
Who provides
step—plugin "flutter3d_post.bloom", orthe application— or null when nobody has taken it. -
settingsFor(
PipelineDocument document, RenderSettings settings) → RenderSettings -
settingswithdocument's switched-off steps off, through RenderSettings.without, the added steps included. Throws an ArgumentError for a step this renderer does not know. -
settingsNamed(
String id) → SettingsSlot< Object> ? -
The slot added under
id, or null. -
toString(
) → String -
A string representation of this object.
inherited
-
whenPlaced(
) → Future< void> -
Completes once every placement started by this renderer's
registrations so far has settled — addComputeStep, addWorkload,
addFieldUpload,
RenderHooks.addSkinningHook, and the compute a node asked for withFrameGraphBuilder.place— placed, refused or failed. -
workloadStep(
ComputeWorkload workload) → WorkloadStep? -
The step
workloadis in the frame as (addWorkload): what it was told, or why it was refused. Null for a workload not added here.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited