Model loading · function

identifyTexture

An image wrapped for embedding, identified by its own header, or a white texel where the header says nothing this format knows, with the reason in warnings.

Explained in Importing models.

function identifyTexture(name: string, bytes: Uint8Array, warnings: string[]): DrftTextureSource
import { identifyTexture } from '@driftengine/assets';

Parameters

ParameterTypeDescription
namestring
bytesUint8Array
warningsstring[]

In depth

The bytes are identified rather than trusted: glTF's mimeType is optional and wrong often enough that the image's own header is the only reliable answer.