AdvancedWhether this pass runs
Flipping it rebuilds the view's render graph on the next render, which suits a settings toggle but not a change every frame; animate an effect's own properties instead. It can also recompile the view's materials; View3D#passes says when.
Readonly AdvancedinputWhether the effect's input has mips, for an effect that reads coarse levels with
sampleColorLod, such as a blur
Costs a mip generation every frame and about a third more memory for the input, so leave it
false unless the effect samples levels above 0.
ReadonlyrequiredMakes the view write velocityOutput while the viewer is enabled
Readonly AdvancedstageThe stage the effect runs at, set by the stage option
StaticdefaultDefaults for every new VelocityViewer; an option passed as undefined keeps its default
Sets the brightness each pixel of motion adds
Brightness per pixel; 1 saturates at one pixel
Advanced
Adds the pass that draws the velocity in place of the chain's image
Render graph being built
This effect's place in the chain; io.input goes unread
Releases GPU resources the pass made outside the graph; the base class has none
The view never calls it, not on replacing view.passes nor on its own destroy, since a pass
can be shared. Call it yourself once the pass is retired. Override it only for resources of your
own: the render passes added in build go with the view's graph, and a plain UniformGroup
needs no release.
Debug effect that shows the scene's velocity in place of the image
Each pixel's hue is the direction its surface moved on screen since the camera's previous render: red is right, yellow-green up, cyan left and violet down. Brightness is the speed; raise scale to see small motions. The velocity comes from the camera's motion alone, so with a still camera every pixel is black, moving objects included. The background is black, and blended and transmissive surfaces show the motion of what's behind them; velocityOutput lists what else writes no velocity.
The view writes velocity only while an enabled pass needs it, so the viewer costs nothing while disabled or left out of View3D#passes.
It runs after tone mapping by default, so the tone curve leaves its colours alone. It replaces the image, so effects before it drop out of the frame and effects after it treat the velocity colours as their input; put it last in
passes.Example