MeshoptCompression | Babylon.js API documentation

API
Babylon.js API documentation
    Preparing search index...

    Class MeshoptCompression

    Meshopt compression (https://github.com/zeux/meshoptimizer)

    This class wraps the meshopt library from https://github.com/zeux/meshoptimizer/tree/master/js.

    Encoder

    The encoder is not currently implemented.

    Decoder

    By default, the configuration points to a copy of the meshopt files on the Babylon.js preview CDN (e.g. https://preview.babylonjs.com/meshopt_decoder.js).

    To update the configuration, use the following code:

        MeshoptCompression.Configuration = {
    decoder: {
    url: "<url to the meshopt decoder library>"
    }
    };

    Implements

    Index

    The configuration. Defaults to the following:

    decoder: {
    url: "https://cdn.babylonjs.com/meshopt_decoder.js"
    }

    Decode meshopt data.

    Parameters

    • source: Uint8Array

      The input data.

    • count: number

      The number of elements.

    • stride: number

      The stride in bytes.

    • mode: "ATTRIBUTES" | "TRIANGLES" | "INDICES"

      The compression mode.

    • Optionalfilter: string

      The compression filter.

    Returns Promise<Uint8Array<ArrayBufferLike>>

    a Promise that resolves to the decoded data