API

Interface Texture2D

A loaded 2D texture: the GPU texture, its default view and sampler, pixel dimensions, and an optional per-texture UV transform. This is the public texture handle returned by loadTexture2D(), createSolidTexture2D(), etc.

interface Texture2D {
    height: number;
    invertY?: boolean;
    sampler: GPUSampler;
    texture: GPUTexture;
    uAng?: number;
    uOffset?: number;
    uScale?: number;
    view: GPUTextureView;
    vOffset?: number;
    vScale?: number;
    width: number;
}

Hierarchy (View Summary)

Index
height: number
invertY?: boolean

True if the texel data is stored with origin at the top (y-down) and must be flipped in V when sampled with standard (y-up) UVs. Applied at UV-transform time in the material, so compressed-format textures (where in-place row flipping is impractical) remain correct.

sampler: GPUSampler
texture: GPUTexture
uAng?: number

Rotation in radians around the (0,0) UV corner.

uOffset?: number
uScale?: number

Per-texture UV transform fields. All optional; defaults make identity. Match BJS Texture.uScale/vScale/uOffset/vOffset/uAng semantics. These fields are build-time: they are sampled when a material pipeline is first compiled. Mutating them after the pipeline is built requires a material rebuild (flag-based rebuild path). If a cached texture wrapper needs a different transform than another use site, create a fresh wrapper via cloneTexture2D().

view: GPUTextureView
vOffset?: number
vScale?: number
width: number