Babylon renders a noisy PBR showcase and the denoiser cleans it, either on its own GPU device with a CPU copy each way, or on Babylon's device with no copies at all.
Two ways to connect Babylon and the denoiser.
CPU copy, two devices: the denoiser runs on its own GPU device, so each frame crosses on the CPU:
RenderTargetTexture.readPixels() (GPU→CPU) → denoiser.denoise() →
RawTexture.update() (CPU→GPU). Works on any engine, WebGL2 included, and the copies are timed below.
Shared device, no copies: the denoiser runs on Babylon's own GPUDevice
(engine._device: Babylon has no public getter for it yet), reads the render target's
GPUTexture directly, and writes into a texture Babylon wraps with
engine.wrapWebGPUTexture(). Nothing leaves the GPU. WebGPU engine only. See the
custom-engines guide.
live round-trip loop
heavy
noise metric –