fast-mesh-wasm
    Preparing search index...

    Interface DracoEncodeOptions

    Options of encodeDraco: the encoder settings plus the extra attributes.

    interface DracoEncodeOptions {
        colors?: ArrayLike<number>;
        compressionLevel?: number;
        encoderModule?: unknown;
        normals?: ArrayLike<number>;
        preserveFaceOrder?: boolean;
        quantizationBits?: DracoQuantizationBits;
        uvs?: ArrayLike<number>;
        wasmBinary?: ArrayBuffer | Uint8Array<ArrayBufferLike>;
    }

    Hierarchy (View Summary)

    Index
    colors?: ArrayLike<number>

    Per-vertex colors: 4 bytes (RGBA) per vertex, encoded as a normalized COLOR attribute. Each value must be an integer 0..255.

    compressionLevel?: number

    How hard the encoder squeezes: an integer 0..10, defaulting to 5. Higher levels encode slower into fewer bytes (the encode/decode speeds run at 10 - level); 0 is the fastest encode.

    encoderModule?: unknown

    A ready draco3d encoder module, as createEncoderModule resolves. When omitted, one is created from the draco3d package and shared across calls. Pass one in to reuse a module (or to supply the .wasm in an environment the default lookup cannot reach, like a bundled Worker).

    normals?: ArrayLike<number>

    Per-vertex normals: 3 numbers per vertex, encoded as the NORMAL attribute. Must match positions in length.

    preserveFaceOrder?: boolean

    Keep the decoded faces (and vertices) in input order via sequential encoding. Defaults to false: the edgebreaker reorders faces while compressing better. Either way the same triangles decode.

    quantizationBits?: DracoQuantizationBits

    Per-attribute quantization bits (each an integer 1..30).

    uvs?: ArrayLike<number>

    Texture coordinates: 2 finite numbers per vertex.

    wasmBinary?: ArrayBuffer | Uint8Array<ArrayBufferLike>

    The encoder .wasm bytes, forwarded to createEncoderModule when the shared module is created. Bundlers cannot always locate draco3d's own .wasm next to its glue (Vite workers, inlined builds): fetch the encoder asset (a ?url import of draco3d/draco_encoder.wasm) and pass its bytes here. Ignored when encoderModule is given.