Skip to content
Shapemetry

Types - Texture

API reference for ./evaluate/texture on @huukhanhnguyen/types.

See the Guide for the package's role.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

TextureData

type

Resolved texture pixels + sampling metadata. The texture-chain ENGINE (which PRODUCES these) stays in the model package — this is the inert output bag the writers consume, and a Material alone cannot carry it (its texture / normalTexture / … fields are URI strings).

type TextureData
// = {
    width: number;
    height: number;
    data: Uint8ClampedArray;
    /** Physical mm of one tile — renderers/exporters prefer this over material tile*. */
    tileWidth?: number;
    tileHeight?: number;
    /** Sampler wrap mode from the chain's declared `wrap` builtin. Absent = repeat. */
    wrap?: "repeat" | "clamp" | "mirror";
    /** Sampler filter from the chain's declared `filter` builtin. Absent = linear. */
    filter?: "linear" | "nearest";
    /** Which UV set this texture samples (0 = TEXCOORD_0, 1 = TEXCOORD_1).
     *  Declared on the CHAIN, not per material slot. */
    uvSet?: 0 | 1;
}
Last updated: 📖 1 min readEdit on GitHub