From 53f3b6790da5e6e10d373a08bc84548b4418423b Mon Sep 17 00:00:00 2001 From: Olivier Biot Date: Mon, 26 Oct 2026 21:02:15 +0800 Subject: [PATCH] Heat Haze example: no white screen on the Canvas renderer The haze is a full-screen sprite whose image is a plain white sheet that only carries the shader effect: on WebGL and WebGPU the effect replaces every pixel of it with the rippled scene. Canvas disables shader effects, so the sheet drew over the whole game and the example showed a solid white frame. The sheet now skips drawing while its effect is off (the Canvas renderer, or a lost GPU context), so Canvas shows the tiles, unlit. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SeWCkETjW35ZbXDRswV1hx --- packages/examples/src/examples/heatHaze/ExampleHeatHaze.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/examples/src/examples/heatHaze/ExampleHeatHaze.tsx b/packages/examples/src/examples/heatHaze/ExampleHeatHaze.tsx index d2967eab99..50520373dd 100644 --- a/packages/examples/src/examples/heatHaze/ExampleHeatHaze.tsx +++ b/packages/examples/src/examples/heatHaze/ExampleHeatHaze.tsx @@ -118,6 +118,12 @@ class HazeSurface extends Sprite { } draw(renderer: Parameters[0], viewport?: object) { + // the white sheet only carries the effect, which replaces every pixel + // of it: with no effect to run (the Canvas renderer, or a lost GPU + // context), the scene under it shows as it is + if (!this.effect.enabled) { + return; + } const scene = renderer.toFrameTexture(); this.effect.setTexture("uScene", scene); // biome-ignore lint/suspicious/noExplicitAny: viewport shape varies by call site