RenderStep class final

One step of the frame that can be switched off — the passes before the scene, the scene's own extras, and the post chain.

A final class with const instances rather than an enum, which tool/structure.dart asks of a published package: the list will grow, and a step added should not break an exhaustive switch somebody wrote.

Each step knows three things:

  • the passes it owns — the frame-graph nodes whose isActive its switch decides, which is what disappears from FrameResult.passes when it is off. Some steps own none: the tone curve, the grade, the lens's bend, the vignette and grain, the distance fog and the caustics are all arithmetic inside a pass that runs anyway;
  • how to switch itself off, by changing its own setting;
  • which other steps it needs (needs). Switching off a step another needs switches that one off too: without({bloom}) is also without the lens flare, which is drawn from the glow, and the flare is reported switched off beside it. Nothing is refused.

What is not a step, and why. The scene itself and the composite are the frame. The surface buffer is not a switch at all: the scene writes it exactly when some surviving pass reads it, so switching off its readers is what removes it. The object ids answer picks already taken. The transparent half and its colour copy run only when the scene holds glass or a reader of its depth, which is content; they are steps all the same (transparent, sceneColorCopy), switched by RenderSettings.stepsOff alone, so a frame can be drawn the way it was before the scene was split.

A step of one's own

The set is open: a plugin defines a step with the public constructor and registers it with RendererSteps.addStep, and from then on it is a step like the thirty built in. It has a name the frame reports it under, the passes it owns, the steps it needs, and a switch, and it gets the same treatment: RenderSettings.without and RenderSettings.only switch it, switching off a step it needs switches it off too, and FrameResult.skipped names it with PassSkip.switchedOff.

Its switch is one of two things:

  • nothing given: the step is switched by being listed in RenderSettings.stepsOff — off once without names it, on again once a copyWith takes it out of the set. The step needs no field of RenderSettings, which it could not add;
  • switchOff and isOn given: the step has a setting of its own somewhere the plugin keeps it, and these two read and write it, as the built-in steps' switches do.

Either way an added step is on only while every step it needs is on, so its own switch need not repeat theirs.

Constructors

RenderStep(String name, {Set<String> passes = const <String>{}, String? passPrefix, Set<RenderStep> needs = const <RenderStep>{}, RenderSettings switchOff(RenderStepContext context)?, bool isOn(RenderStepContext context)?})
A step of a plugin's, or an application's — see "A step of one's own" above.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
isBuiltIn → bool
Whether this is one of the engine's own steps, in values, rather than one a plugin or an application defined.
no setter
name → String
What the step is called in FrameResult.skipped when it is off.
final
needs → Set<RenderStep>
Steps this one cannot run without. Switching any of them off switches this one off too.
final
passes → Set<String>
The frame-graph nodes this step's switch decides, by name.
final
passPrefix → String?
The passes whose names carry an index — reflection probe 3 — owned by prefix, since their count belongs to the scene.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

isOn(RenderStepContext context) → bool
Whether this step's own switch is on in context: in its settings, and for an added step's own switch whatever else of the frame it reads.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ownsPass(String pass) → bool
Whether the pass called pass is one of this step's.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

byName(String name) → RenderStep?
The value called name, or null for a name this version does not know, which is what a file written by a later version can carry.

Constants

ambientOcclusion → const RenderStep
Ambient occlusion and its blur, whichever method. Off is ambientOcclusion.enabled false.
autoExposure → const RenderStep
The meter that adapts the exposure. Off is autoExposure.enabled false; the composite then uses RenderSettings.exposure.
bloom → const RenderStep
Off is bloom.enabled false.
caustics → const RenderStep
Light through glass followed as photons into the directional map — ShadowSettings.caustics. Drawn inside the shadow pass, so it owns no pass of its own, and needs shadows.
colorGrade → const RenderStep
The grade: contrast, saturation, temperature, lift, gamma, gain, white balance, tint and the colour table. Off sets each to its neutral value and leaves the lens, the film and the dither as they were.
contactShadows → const RenderStep
The short march towards the sun at every pixel, and the resolve that averages its dither. Off is contactShadows.enabled false.
decals → const RenderStep
Decals painted onto the opaque half. Off is decals.enabled false.
depthOfField → const RenderStep
Off is depthOfField.enabled false.
edgeSmoothing → const RenderStep
FXAA or SMAA on the finished picture. Off is antiAlias.enabled false.
fog → const RenderStep
The distance and height fog the lit stages mix in. Off is a density of nought; arithmetic inside the scene pass, so no pass of its own.
highContrast → const RenderStep
The high-contrast look and the outlines it rings marked nodes in. Off is highContrast.enabled false.
hiZOcclusion → const RenderStep
The occlusion read back for culling by the next frame — C3, the depth pyramid. Off sets occlusion from OcclusionMode.hiZ to OcclusionMode.none; a software occlusion test, which needs no pyramid, is left alone.
irradianceUpdate → const RenderStep
The irradiance field's probes updated on the GPU. Off is RenderSettings.irradianceUpdates false: the field keeps the light it has gathered and the scene goes on reading it.
lensDistortion → const RenderStep
The lens's bend and its colour fringes — look.distortion and look.chromaticAberration, both nought when off.
lensFlare → const RenderStep
Ghosts and a halo drawn from the glow, so it needs bloom. Off is bloom.lensFlare.enabled false.
lightShafts → const RenderStep
Shafts of sunlight through the air. Off is lightShafts.enabled false.
localExposure → const RenderStep
Off is localExposure.enabled false.
motionBlur → const RenderStep
Off is motionBlur.enabled false. Needs velocity.
planarReflections → const RenderStep
The mirrored pictures behind each planar reflector. Off is planarReflections.enabled false.
reflectionProbes → const RenderStep
The scene's reflection probes, recaptured. Off is RenderSettings.reflectionProbes false: the probes keep the last picture they took and the scene goes on sampling it.
reflections → const RenderStep
Screen-space reflections. Off is reflections.enabled false.
renderTextures → const RenderStep
Every RenderTexture drawn through its own camera. Off is RenderSettings.renderTextures false: each texture keeps its last picture.
sceneColorCopy → const RenderStep
The copy of the opaque half the glass reads the scene behind it from, at six sizes. Off keeps the split, and the glass in the second half reads the environment. Needs transparent, its only reader; switched, like it, by RenderSettings.stepsOff.
shadows → const RenderStep
Every shadow map: the directional cascades, both cube atlases and the blurred moments the evsm filter reads. Off is shadows.enabled false, and every lit pass then shades unshadowed.
sharpening → const RenderStep
Contrast-adaptive sharpening, after the edge smoothing, the temporal resolve or the upscale, whichever asked for it. Off sets all three strengths to nought.
spatialUpscale → const RenderStep
The finished picture brought up from a reduced render scale. Off is spatialUpscale.enabled false, and the frame is stretched by the present instead.
temporalAntiAliasing → const RenderStep
The jittered frames blended across time, with the reactive mask that guides it and the two histories it keeps for the noisy effects. Off is antiAlias.temporal.enabled false. Needs velocity.
tonemap → const RenderStep
The tone curve, and a display transform in its place. Off is tonemap false: the composite clamps instead.
transparent → const RenderStep
The scene's second half — M3: on a frame that holds glass, a contributor that reads the scene's depth, a material that reads the scene behind it, or decals, the transmissive and transparent draws and the contributors are drawn in a pass of their own after the opaque half, over what it stored.
values → const List<RenderStep>
Every step, in the order the frame meets them.
velocity → const RenderStep
The motion of every pixel since the last frame: the camera's, and the nodes' that moved over it — FrameResourceIds.velocity.
viewportShading → const RenderStep
The editor's normals, clay, outline and curvature views. Off is ViewportShading.off.
vignetteAndGrain → const RenderStep
The film: look.vignette and look.grain, both nought when off.
volumetricFog → const RenderStep
The fog marched through the light. Off is volumetricFog.enabled false.