Vixen
02b45cc4
csharp
public sealed class MotionBlurRenderer

The smear a shutter that is open for a finite time leaves behind.

Read the guide page for this →

Remarks

The shutter comes off the camera, not off a slider here. Camera.ShutterTime already decides the exposure; this is the second thing it decides. A motion vector spans one frame, and what happened during the exposure is the fraction of that frame the shutter was open for — so 1/60 at 60 Hz is a full frame of smear and 1/500 is almost none, which is the relationship a real camera has. An intensity beside the aperture would be one more number free to disagree with the brightness, which is the fault the whole camera merge was about.

⚠ It needs a motion-vector target, and there is exactly one way to get one: a stage whose shader is MotionVectors, drawn into a colour target of at least two signed channels. Without it every pixel reads zero and the pass is a copy — which is what a frame that forgot the stage looks like, and is why the node names the resource rather than guessing it.

⚠ Before the tonemap. A smear is light landing on the sensor over an interval, so averaging it is averaging radiance; after the curve it would average two different curves' outputs and a bright object crossing a dark one would smear grey rather than bright.

Fields and properties (10)

  • public required string Source

    The scene colour it smears.

  • public required string MotionVectors

    Where every pixel was last frame.

  • public RenderView? View

    The view whose camera carries the shutter.

  • public float DeltaTime

    How long the last frame took, for turning a shutter time into a fraction.

  • public const float DefaultShutterFraction

    A 180° shutter, which is half of each frame.

  • public int Samples

    How many taps the line is sampled with.

  • public bool UseNeighbourMax

    Whether a pixel takes the longest velocity near it rather than only its own.

  • public float MaximumRadius

    The longest smear allowed, in pixels.

  • public float MinimumRadius

    Below this many pixels of motion the pass is a copy.

  • public float ShutterFraction

    What fraction of a frame the shutter is open for.

Methods (2)

  • public MotionBlurRenderer()

    The smear a shutter that is open for a finite time leaves behind.

  • protected override void Configure(CompositorFrame frame, ParameterCollection parameters, IList<ResourceBinding> bindings)

    Fills in this frame's parameters and bindings.

Used by (2)

  • PostEffectFactoryVixen.Rendering.PostFx
  • PostEffectTestsVixen.Rendering.PostFx.Tests