API

Function createTexture2DArray

  • Create an empty 2D texture array of layers same-size layers (RGBA8 unless options.format says otherwise), ready to be filled with uploadImageToArrayLayer() / loadImageToArrayLayer().

    The texture is created with TEXTURE_BINDING | COPY_DST | RENDER_ATTACHMENT usage — copyExternalImageToTexture (used by the upload helpers) 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

      Layer width in texels (>= 1).

    • height: number

      Layer height in texels (>= 1).

    • layers: number

      Number of array layers (>= 1).

    • options: TextureArrayOptions = {}

      Sampler / format overrides.

    Returns Texture2DArray