Builtin Library
README.md
motionBlur
The settings behind the MotionBlur component, and the way to drive the shutter
from a script — a photo mode that opens it wide, a quality slider that drops the
tap count, a cutscene that closes it for a freeze.
local motionBlur = require("@builtin::systems.motionBlur.motionBlur")
motionBlur.set({ shutterAngle = 180, samples = 16 })
motionBlur.get() -- a copy of the settings in force
motionBlur.active() -- whether the passes are running
motionBlur.clear() -- close the shutter, keep the settings
set takes any subset of the fields; whatever is omitted keeps its current
value. A shutterAngle of 0 releases the render feature entirely rather than
running three passes that do nothing, and clear is the named way to say the
same thing.
The module packs the settings into the motion_blur_params buffer the passes
read, so a change lands on the next frame without recompiling anything.
Shutter angle converts to the fraction of a frame the shutter is open —
angle / 360. That fraction multiplies the velocity buffer directly, which is
what ties blur length to a physical camera parameter rather than to an arbitrary
strength slider.