Type Alias VFXPass

VFXPass: {
    vert?: string;
    frag: string;
    target?: string;
    persistent?: boolean;
    float?: boolean;
    size?: [number, number];
    uniforms?: VFXUniforms;
}

A single render pass in a multipass shader pipeline.

Each pass renders to a named buffer (specified by target), which can be
referenced as a sampler2D uniform in subsequent passes.
The last pass in the array renders to the screen.

Type declaration

  • Optionalvert?: string

    Vertex shader code.
    If omitted, the default vertex shader is used.

  • frag: string

    Fragment shader code.

  • Optionaltarget?: string

    Name of the buffer to write this pass's output to.
    Later passes can reference it as uniform sampler2D <target>;.

    If specified, output is written to a named render target.
    If omitted on an intermediate pass, auto-assigned as pass0, pass1, etc.
    If omitted on the last pass, renders to screen.

  • Optionalpersistent?: boolean

    Whether this pass's render target should persist across frames.
    When enabled, the previous frame's output is available as
    sampler2D <target> (i.e. the target name doubles as the
    previous-frame texture, following the ISF convention).

  • Optionalfloat?: boolean

    Use 32-bit floating point render target. (Default: false)
    Enable when storing non-visual data or values outside [0, 1].

  • Optionalsize?: [number, number]

    Render target size in pixels [width, height].
    When set, the backbuffer and intermediate buffer are created at this
    fixed size instead of the viewport resolution.

  • Optionaluniforms?: VFXUniforms

    Uniform values to be passed to this pass's shader.
    Works the same way as element uniforms.