API

Interface DynamicTexture2D

A Texture2D created by createDynamicTexture: allocated blank with COPY_DST | RENDER_ATTACHMENT usage so it can be written repeatedly from an external-image source. It is a Texture2D (drops straight into any material texture slot), plus an opaque nominal brand that constrains updateDynamicTexture to accept only textures produced here — a plain Texture2D from loadTexture2D / createTexture2DFromPixels is rejected at compile time.

interface DynamicTexture2D {
    "[dynamicTexture2DBrand]": true;
    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
"[dynamicTexture2DBrand]": true

Opaque nominal brand.

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