Function updateDynamicTexture
-
updateDynamicTexture(
engine: EngineContext,
tex: DynamicTexture2D,
source: GPUCopyExternalImageSource,
opts?: DynamicTextureUpdateOptions,
): voidParameters
- engine: EngineContext
Engine context.
- tex: DynamicTexture2D
Target texture (from createDynamicTexture).
- source: GPUCopyExternalImageSource
A WebGPU external-image source sized
tex.width×tex.height. - opts: DynamicTextureUpdateOptions = {}
Flip-Y / premultiply overrides.
Returns void
- engine: EngineContext
Push pixels into a createDynamicTexture texture from an external-image source — a canvas (
HTMLCanvasElement/OffscreenCanvas),ImageBitmap,ImageData,HTMLImageElement,HTMLVideoElement, orVideoFrame. All of these are accepted directly by WebGPU'scopyExternalImageToTexture, so this is a single GPU copy with no CPU readback. If the texture was created with mipmaps, its mip chain is regenerated after upload.