API

Function updateTexture2DArrayFromPixels

  • Re-upload one mip level of every layer of a texture array from a tightly-packed RGBA8 byte buffer. This is the runtime counterpart to createTexture2DArrayFromPixels.

    Uploading the base level (mipLevel = 0) of a mipmapped array regenerates the rest of the chain; uploading an explicit higher level writes only that level, so an application can author its own mip chain level by level.

    Parameters

    • engine: EngineContext

      Engine context.

    • tex: Texture2DArray

      Target texture array (from createTexture2DArray / createTexture2DArrayFromPixels).

    • data: Uint8Array

      mipWidth * mipHeight * tex.layers * 4 bytes, RGBA8, layer-major.

    • mipLevel: number = 0

      Destination mip level (default 0). Level dimensions are max(1, size >> mipLevel).

    Returns void