@pixi/3d
    Preparing search index...

    Class MotionBlurEffect

    Blurs the image along the direction each pixel moved since the camera's previous render

    Only the camera's motion counts: turning or moving the camera streaks opaque meshes, though not the view's background, an object moving in front of a still camera stays sharp, and one that moves with the camera, such as a cockpit, streaks with the scene. Each streak is measured per rendered frame, so it shortens as the frame rate rises, as a real camera's does. The effect reads velocityOutput, which notes the surfaces that have no velocity of their own, such as blended ones.

    On a camera cut, such as a teleport or a change of shot, call Camera3D#resetHistory so the first frame of the new shot isn't smeared by the jump. Every property can change every frame.

    view.passes = [new MotionBlurEffect({ intensity: 0.75 })];
    

    Hierarchy (View Summary)

    Index
    enabled: boolean

    Whether 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.

    const wireframe = new MeshPass({ name: 'wireframe' });
    view.passes = [wireframe];
    wireframe.enabled = false;
    inputMips: boolean = false

    Whether 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.

    requiredOutputs: SceneOutput[] = ...

    Always [velocityOutput], so the view writes the velocity while the effect is enabled

    The stage the effect runs at, set by the stage option

    defaultOptions: MotionBlurEffectOptions = ...

    Defaults for every new MotionBlurEffect; an option passed as undefined keeps its default

    MotionBlurEffect.defaultOptions.samples = 8;
    
    • get intensity(): number

      How much of a frame's motion each streak covers; 0.5 is a film camera's shutter

      Returns number

      motionBlur.intensity = 1;
      
    • set intensity(value: number): void

      Sets how much of a frame's motion each streak covers

      Parameters

      • value: number

        Fraction of the frame's motion; above 1 exaggerates it.

      Returns void

    • get maxLength(): number

      Longest streak, in physical pixels on screen; longer ones are scaled down to it

      Returns number

      motionBlur.maxLength = 24;
      
    • set maxLength(value: number): void

      Sets the longest streak

      Parameters

      • value: number

        Length in physical pixels on screen.

      Returns void

    • get samples(): number

      Taps per pixel along the streak; the cost of the pass grows with it

      Returns number

      motionBlur.samples = isMobile ? 6 : 12;
      
    • set samples(value: number): void

      Sets the taps per pixel

      Parameters

      • value: number

        Taps along each streak, rounded, at least 1.

      Returns void

    • Advanced

      Adds the blur pass for this slot in the chain

      Parameters

      • graph: RenderGraph

        Render graph being built.

      • io: EffectIO

        Input/output handles for this slot in the chain.

      Returns void

      const blurred = graph.createColor({ label: 'blurred' });
      motionBlur.build(graph, { ...io, output: blurred });
    • 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.

      Returns void

      view.passes = [];
      wireframe.destroy();