@pixi/3d
    Preparing search index...

    Class WireframePass

    Debug pass that redraws opted-in meshes as lines over their shaded result

    Add it to View3D.passes, and opt a mesh in with passes: { wireframe: true } on its material. Depth testing is off, so edges on the far side of a mesh show through. By default it draws after every scene draw, so the lines show over everything.

    The lines aren't an exact wireframe: the pass draws a mesh's triangle indices in pairs, so some edges are missed and some lines join one triangle to the next. That's enough to inspect a mesh.

    new View3D({ passes: [new WireframePass({ color: 0x00ff66 })] });
    new Material3D({ passes: { wireframe: 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: WireframePassOptions = ...

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

    WireframePass.defaultOptions.color = 0xff00ff;
    
    • 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();