Appearance
@tmrw-realityos/charm • Docs
@tmrw-realityos/charm / createTextureFromImage
Function: createTextureFromImage()
createTextureFromImage(
device
,image
,existingTexture
?):WebGPUTexture
Create WebGPU texture from HTML image
Parameters
• device: GPUDevice
GPU device
• image: HTMLImageElement
Image
• existingTexture?: WebGPUTexture
Existing target texture to load data into. If undefined, a new WebGPUTexture instance is returned.
Returns
WebGPU texture in rgba8unorm format