Documentation
    Preparing search index...

    Interface GltfLoaderOptions

    Construction options for createGltfLoader.

    interface GltfLoaderOptions {
        allowAbsoluteUris?: boolean;
        decodeText?: TextDecodeLike;
        decodeTexture?: TexelDecodeLike;
        fetch?: FetchLike<unknown>;
        maximumBytes?: number;
        maximumDecodedBytes?: number;
        maximumExpansionRatio?: number;
        maximumWorkingBytes?: number;
        name?: string;
        probeTexture?: TexelProbeLike;
    }
    Index
    allowAbsoluteUris?: boolean

    Whether a document may name an absolute or root-relative subresource URI (https://…, //host/…, /path, any scheme:). Defaults to false: a glTF is untrusted content (§96), and a document that can pick the origin its .bin comes from can direct the injected transport anywhere. Relative URIs resolve lexically against the asset's own URL and cannot climb above its root. Set true for a trusted CDN layout.

    decodeText?: TextDecodeLike

    UTF-8 decoder for .gltf bodies and GLB JSON chunks. Defaults to globalThis.TextDecoder; refused loudly when neither exists.

    decodeTexture?: TexelDecodeLike

    The image decoder for base-colour textures — createTextureLoader's own seam, injected for its reason (this package names no Blob, no ImageBitmap, no canvas).

    Presence is the capability, and the failure is a refusal: a document whose materials sample a base-colour texture cannot load without a decoder — a silently untextured model is the wrong picture. Documents that use no textures need none.

    fetch?: FetchLike<unknown>

    Transport for external buffer and image URIs (.bin files, image files), resolved against the asset's own URL — the same FetchLike seam the AssetManager uses, and typically the very same function.

    Presence is the capability: without it, embedded content (GLB BIN chunks, base64 data: URIs) loads exactly as with it, and a document naming an external URI is refused loudly at the reference — a model with a missing buffer is not a model with fewer vertices.

    maximumBytes?: number

    §96 size bound for each subresource this loader fetches or decodes itself — an external buffer, a base64 payload. Defaults to DEFAULT_MAXIMUM_BYTES. The glTF body itself is bounded by the AssetManager that fetched it.

    maximumDecodedBytes?: number

    §96 decoded-texture bound, forwarded to createTextureLoader.

    maximumExpansionRatio?: number

    §96 expansion-ratio bound, forwarded to createTextureLoader.

    maximumWorkingBytes?: number

    Require a bounded image decoder; forwarded to the texture tier (§96).

    name?: string

    Diagnostics label used in error context.loader. Defaults to "gltf".

    probeTexture?: TexelProbeLike

    Optional header probe, forwarded to the texture tier (§96 pre-checks).