API

Function createDynamicTexture

  • Create a blank, immediately-sampleable DynamicTexture2D of width × height whose pixels are pushed on demand with updateDynamicTexture. Reads as transparent black until the first update.

    The texture is created with TEXTURE_BINDING | COPY_DST | RENDER_ATTACHMENT usage — copyExternalImageToTexture (used by the update helper) requires both COPY_DST and RENDER_ATTACHMENT on the destination, and the render attachment is also what the mipmap-blit pass writes into.

    Parameters

    • engine: EngineContext

      Engine context.

    • width: number

      Texture width in texels (>= 1).

    • height: number

      Texture height in texels (>= 1).

    • options: DynamicTexture2DOptions = {}

      Sampler / format / mipmap overrides.

    Returns DynamicTexture2D