@pixi/3d
    Preparing search index...

    Class OutlinePass

    Draws an ink outline around opted-in meshes, for a toon look

    Each mesh is redrawn as a slightly larger shell showing only its back faces, which the mesh hides except for a rim around its silhouette. Add the pass to View3D.passes, and opt a mesh in with passes: { outline: true } on its material. Skinned and morphed meshes outline correctly.

    new View3D({ passes: [new OutlinePass({ width: 0.05 })] });
    new Material3D({ baseColor: 0xff7733, passes: { outline: true } });

    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;
    name: string

    Pass name materials opt in with

    requiredOutputs?: readonly SceneOutput[]

    Extra outputs the view's scene draw writes beside its colour while this pass is enabled

    Each costs the scene draw a texture and the shader work to fill it, and any output makes the view draw its scene into a texture first, as a post effect does. Reach an output's texture with RenderGraph#getSceneOutput, to read it or draw into it.

    const objectIdOutput: SceneOutput = { name: 'objectId', format: 'r32uint' };

    class MyPickingPass extends Pass3D {
    public readonly stage = 'afterTransparent';
    public readonly requiredOutputs = [objectIdOutput];
    public build(): void {}
    }
    defaultOptions: OutlinePassOptions = ...

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

    OutlinePass.defaultOptions.width = 0.05;
    
    • 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();