From 7f3ca3c97ed0256fda52551abd06d71a00f7ed88 Mon Sep 17 00:00:00 2001 From: scamiv <6170744+scamiv@users.noreply.github.com> Date: Fri, 26 Dec 2025 19:11:05 +0100 Subject: [PATCH] Update GameRenderer to disable alpha channel in GameRenderer 2D context (#2699) ## Description: Updated the main onscreen canvas context to opaque: Impact: avoids alpha compositing for the main canvas (we already paint a full opaque background each frame), which can slightly reduce GPU work. ## Please complete the following: - [ ] I have added screenshots for all UI updates - [ ] I process any text displayed to the user through translateText() and I've added it to the en.json file - [ ] I have added relevant tests to the test directory - [ ] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: DISCORD_USERNAME --- src/client/graphics/GameRenderer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/graphics/GameRenderer.ts b/src/client/graphics/GameRenderer.ts index 301dc3486..152a82587 100644 --- a/src/client/graphics/GameRenderer.ts +++ b/src/client/graphics/GameRenderer.ts @@ -298,7 +298,7 @@ export class GameRenderer { private layers: Layer[], private performanceOverlay: PerformanceOverlay, ) { - const context = canvas.getContext("2d"); + const context = canvas.getContext("2d", { alpha: false }); if (context === null) throw new Error("2d context not supported"); this.context = context; }