Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit15ce14a4c1

README.md

renderer.postStages

The frame's post stages: the ordered list of named seams every post effect runs at. Each stage states the colour space of the picture it holds (light, scene-referred light the display transform has yet to fit to the screen, or display, display-referred code values) and its resolution (raster, output, reduced, or rasterToOutput for a stage that starts on the raster and carries the picture to the output size). A render feature declares stage = "<name>" and a post-process chain shader stage: <name> in its properties.yaml; the engine schedules each from this list, a feature's passes inside the stage's band of orders at its pipeline phase and a chain effect at the stage's chain layer. renderer.post.stages() reports the list with the effects standing in each stage.

Inside a stage a feature's pass takes a local order from 0 up to BAND, and passes sharing an order run in the order they were enqueued, so a feature whose passes depend on one another (a chain over shared targets) can run them at one order, in sequence. A pass may name a stage of its own (stage = "display", order = 2): a feature whose work spans two stages, such as temporal antialiasing (its resolve in temporal, its sharpening in display), declares one and names the other on those passes. A chain effect takes its place among the chain effects of its stage by priority, a number, or "last", after every numbered chain effect of the stage; chain effects sharing a priority, two "last" among them, run in the order they registered. The ui stage runs afterUI feature passes, then its chain effects, then afterPost feature passes, so an afterPost pass runs after every chain effect of the stage.

A render feature's passes in display and ui run in the presented frame (renderer.presentedFrames, a capture of source = "presented"); an offscreen render (a capture from a camera or a station, a render-to-texture camera) runs the display transform and the chain's display layer, and the render features of every stage up to optics. It runs the chain's all layer as well when it renders the picture as the screen presents it: a capture does, and so does a render-to-texture camera with textureColorSpace = "presented". Any other texture camera's picture takes the all layer from the frame that shows it.

Where the built-in effects run:

stagebuilt-in effects
lightingocclusion, reflections, indirect light, contact shadows, subsurface scattering, area lights, decals, splats, outlines, debug draws and diagnostic views
mediumaerial perspective, height fog, volumetric light
preTemporaldepth of field
temporaltemporal antialiasing
postTemporalmotion blur
meterthe exposure meter
opticslens flare (render feature), bloom (chain)
displaythe display transform, then the temporal upscale, debanding, edge antialiasing (FXAA) and sharpening (RCAS, CAS), then the chain's looks and the film grain (lensFx.grain, priority = "last")
uithe UI, then the cutscene fade and letterbox (priority = "last")
outputthe surface encoding

The stages, in frame order: lighting, medium, preTemporal, temporal (one effect at a time), postTemporal, meter, optics, display, ui and output.

  • list() answers every stage in frame order, each a copy: { name, space, resolution, single, runs, feature, chain?, chainFirst }.
  • get(name) answers the stage a name names, or nil and a message listing the stages there are.
  • index(name) answers where a stage stands in the frame, 1 for the first.
  • chainLayer(name) answers the chain layer (scene, display or all) a post-process effect declaring that stage runs at, or nil and the reason.
  • stageOfLayer(layer) answers the stage a chain layer's effects run in.
  • stageOfPosition(phase, order) answers the stage a render-feature pass placed by phase and order stands in.
  • BAND is how many orders one stage's band at a phase spans: a declared feature's local order counts from 0 up to, and short of, it.