From 78c57d558ea662dc74aa005ec74cf533d8ac11bc Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 6 Oct 2026 14:06:41 +0000 Subject: [PATCH] Add a TODO about the blending of semi-transparent pixels on layers with post-processing effects Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HdyuCYDD8w7U2Q3p1aHY5M --- GDJS/Runtime/pixi-renderers/layer-pixi-renderer.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/GDJS/Runtime/pixi-renderers/layer-pixi-renderer.ts b/GDJS/Runtime/pixi-renderers/layer-pixi-renderer.ts index 94064b589a..acdb12a6cd 100644 --- a/GDJS/Runtime/pixi-renderers/layer-pixi-renderer.ts +++ b/GDJS/Runtime/pixi-renderers/layer-pixi-renderer.ts @@ -599,6 +599,12 @@ namespace gdjs { outputPass.material.blendEquation = THREE.AddEquation; outputPass.material.blendSrc = THREE.OneFactor; outputPass.material.blendDst = THREE.OneMinusSrcAlphaFactor; + // TODO: the composer blends transparency in linear space, unlike + // rendering without post-processing (in sRGB space), and the output + // pass converts premultiplied colors to sRGB. So semi-transparent + // pixels can be brighter than without effects, especially over + // the layers below. Fixing this needs a decision on which blending + // to match, keeping the light added by a bloom on transparent pixels. this._threeFinalPasses.push(outputPass); for (const pass of this._threeFinalPasses) { this._threeEffectComposer.addPass(pass);