Documentation
    Preparing search index...

    Interface RenderItemStencil

    A stencil configuration as a render item carries it — structurally identical to §57's StencilState, and deliberately not that class.

    @fourjs/materials' StencilState is nominal (private fields) precisely so that material.ts can import it type-only and a bundle that never masks does not carry it (R-7, measured at 0.62 kB gzip). Constructing one here would undo that for every bundle that carries a render list — i.e. all of them — so this module builds plain records instead and the backend, which has always read §57's state structurally, cannot tell the difference. The two string unions are imported import type, which costs nothing at runtime.

    Every field is present, so a backend's defensive ?? default reads never fire on one of these.

    interface RenderItemStencil {
        depthFailOp: StencilOp;
        failOp: StencilOp;
        func: StencilFunc;
        passOp: StencilOp;
        readMask: number;
        ref: number;
        writeMask: number;
    }
    Index
    depthFailOp: StencilOp

    Stored when the stencil test passes and the depth test fails.

    failOp: StencilOp

    Stored on stencil-test failure.

    The comparison; see StencilFunc. (ref & readMask) OP (stored & readMask).

    passOp: StencilOp

    Stored when both tests pass.

    readMask: number

    The bits the test looks at, 0…255.

    ref: number

    The reference value, 0…255.

    writeMask: number

    The bits a write may change, 0…255; 0 for a read-only test.