Builtin Library
README.md
antiAliasing
The settings behind the EdgeAntiAliasing component, and the way to drive edge
antialiasing from a script — a quality slider, or a capture path that wants it
off.
local antiAliasing = require("@builtin::systems.antiAliasing.antiAliasing")
antiAliasing.enable({ edgeThreshold = 0.125, searchSteps = 12 })
antiAliasing.get() -- a copy of the settings in force
antiAliasing.active() -- whether the pass is running
antiAliasing.disable() -- release the pass, keep the settings
enable takes any subset of the fields; whatever is omitted keeps its current
value. disable releases the render feature rather than running a pass that
would pass every pixel through.
The module packs the settings into the fxaa_params buffer the pass reads, so a
change lands on the next frame without recompiling anything.
Cost
The pass is one dispatch over the frame. Its cost is dominated by the edge walk,
which only runs for pixels that pass the threshold test — so edgeThreshold is
both the quality knob and the cost knob, and searchSteps bounds the walk. On a
frame with few edges the pass is close to a copy.