Color differences in TSL for an alpha material

I posted an issue here on Github: NodeMaterial/TSL Color Space issues when loading custom texture data · Issue #30467 · mrdoob/three.js · GitHub and am moving the discussion here.

Description

I am working on a migration of my project from WebGLRenderer to WebGPURenderer + TSL. In my project I have a custom function that decompresses raw texture bytes to SRGB data colors using texelFetch, then converts them to linear color space in the vertex shader. The project I work on is very sensitive to color spaces so I have spent some time to make sure my WebGLRenderer setup is correct.

I am trying to get the exact same color output from both the WebGLRenderer and the WebGPURenderer. I believe I am having an issue with color spaces and Alpha. In this JFiddle: Tsl Transparency issue - JSFiddle - Code Playground I have a node material and shader material that are attempting to be the same, but they are rendering differently.


Transparency rendering with WebGLRenderer is not 100% correct since it applies sRGB color space conversion inline which means means pixel are blended in sRGB. That is not a correct blending procedure however.

WebGPURenderer applies tone mapping and color space conversion as a separate pass which eliminates the rendering issue. So the colors in WebGPURenderer are actually correct.

Notice that when using EffectComposer with WebGLRenderer, the colors are correct as well since the inline tone mapping and color space conversion is disabled and applied with a post processing pass (OutputPass). That caused confusion in the past since transparent colors looked different when using FX. With WebGPURenderer, the colors look now always correct.