Function CreateTexture2DArrayFromKTX2Async
-
CreateTexture2DArrayFromKTX2Async(
scene: Scene,
data: string | ArrayBufferView<ArrayBufferLike>,
options?: ICreateTexture2DArrayFromKTX2Options,
): Promise<RawTexture2DArray>Parameters
- scene: Scene
defines the hosting scene
- data: string | ArrayBufferView<ArrayBufferLike>
defines the url of the KTX2 file, or its already fetched content
Optionaloptions: ICreateTexture2DArrayFromKTX2Optionsdefines optional creation settings
Returns Promise<RawTexture2DArray>
a promise resolved with the created RawTexture2DArray
- scene: Scene
Creates a 2D array texture from a single KTX2 file holding several array layers (layerCount greater than 1). This is the single-file counterpart to CreateTexture2DArrayFromImageUrlsAsync: rather than fetching one image per layer, the whole array travels in one container.
The data is transcoded to uncompressed RGBA. Keeping the texture in its transcoded compressed form would require compressedTexImage3D support in the engine raw texture path, which does not exist yet, so the GPU cost here matches a plain RGBA array texture.
Only the base mip level stored in the file is uploaded; when generateMipMaps is on, the remaining levels are regenerated by the engine. Uploading the file's own mip chain needs per-mip array uploads, which WebGL's updateRawTexture2DArray does not support today.