Appearance
@tmrw-realityos/charm • Docs
@tmrw-realityos/charm / createTextureFromKTX2Data
Function: createTextureFromKTX2Data()
createTextureFromKTX2Data(
device
,data
,existingLoader
?,existingTexture
?,onComplete
?):WebGPUTexture
Create a GPU texture in compressed or uncompressed format, depending on device features.
Parameters
• device: GPUDevice
GPU device
• data: ArrayBuffer
KTX data as arraybuffer
• existingLoader?: KTX2TextureLoader
Existing KTX2 texture loader.
• existingTexture?: WebGPUTexture
Existing target texture to load data into. If undefined, a new WebGPUTexture instance is returned.
• onComplete?
Callback when the texture data is decoded and written to the GPUTexture handle.
Returns
WebGPU texture in compressed format