API

Function createHtmlTexture

  • Create an HTML texture from a live element. When an update path exists, the element is re-parented under the rendering canvas (restored on dispose), the texture is allocated blank, and — on the native path — a paint listener is attached so the texture tracks the element. Reads as transparent black until the first paint uploads.

    Parameters

    • engine: EngineContext

      Engine context (must render into a DOM canvas, not an OffscreenCanvas).

    • element: HTMLElement

      The DOM element to rasterise.

    • options: HtmlTexture2DOptions = {}

      Size / sampler / update overrides.

    Returns HtmlTexture2D