Model loading · interface

AssetReference

A texture a model named, with its bytes when the model carried them inline.

Explained in Importing models.

interface AssetReference
import type { AssetReference } from '@driftengine/assets';

In depth

One type for both cases because the difference is the format's business and not the baker's: glTF may embed an image in its binary chunk or in a data URI, and may equally point at a file beside itself, while FBX and OBJ only ever name a path. A reader reports whichever it has, and the resolver looks up only what arrived without bytes.

Properties

NameTypeDescription
namereadonlystringWhat the source called it. Used to address the texture later, and to find it now.
bytesreadonlyoptionalUint8ArrayPresent when the model carried the image itself, so nothing needs resolving.