API

Interface HtmlTexture2DOptions

Options for createHtmlTexture.

interface HtmlTexture2DOptions {
    addressModeU?: GPUAddressMode;
    addressModeV?: GPUAddressMode;
    autoUpdate?: boolean;
    height?: number;
    invertY?: boolean;
    magFilter?: GPUFilterMode;
    minFilter?: GPUFilterMode;
    mipMaps?: boolean;
    srgb?: boolean;
    useSvgFallback?: boolean;
    width?: number;
}

Hierarchy (View Summary)

Index
addressModeU?: GPUAddressMode

Address mode U. Default 'clamp-to-edge'.

addressModeV?: GPUAddressMode

Address mode V. Default 'clamp-to-edge'.

autoUpdate?: boolean

Re-upload automatically whenever the hosted element changes (native path only — the SVG fallback is a static snapshot). Default true.

height?: number

Texture height in texels. Default element.offsetHeight || 256.

invertY?: boolean

Present the sampled result upright under Lite's Y-up convention. Baked into the texture pixels (a GPU V-flip on the native path, an upload flipY on the SVG fallback), so it is correct in any material slot. Set false to keep the element's native top-row-first orientation. Default true.

magFilter?: GPUFilterMode

Mag filter. Default 'linear'.

minFilter?: GPUFilterMode

Min filter. Default 'linear'.

mipMaps?: boolean

Generate a mip chain (rebuilt after each updateDynamicTexture). Default false.

srgb?: boolean

Use sRGB format (rgba8unorm-srgb) so the hardware converts to linear on sample. Use for colour content (text labels, procedural patterns) fed to a PBR/standard material; leave false for data. Default false.

useSvgFallback?: boolean

Fall back to an SVG <foreignObject> static snapshot when the native HTML-in-Canvas API is unavailable. Default true.

width?: number

Texture width in texels. Default element.offsetWidth || 256.