API

Interface HtmlTexture2D

A DynamicTexture2D whose pixels are rasterised from a live HTMLElement by createHtmlTexture. Drops into any material texture slot; the extra fields are internal bookkeeping for the hosted element and paint listener.

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

"[htmlTexture2DBrand]": 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