API

Interface Texture2DArray

A 2D texture array handle. It is a Texture2D (so it drops straight into setEffectTexture / material sampler bindings) whose view is created with dimension:"2d-array", plus a layers count. Bind it to a shader sampler declared viewDimension:"2d-array" and sample it in WGSL as texture_2d_array<f32>.

interface Texture2DArray {
    height: number;
    invertY?: boolean;
    layers: number;
    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.

layers: number
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