- Edited
I've been trying to create a screen-reading shader that applies a chromatic aberration effect to some text that will pop up while the game is being played. The problem is that the shader reads everything, meaning the effect is being applied to the 3D world. I've tried setting up a SubViewport with a SubViewportContainer parent to separate what's effected by the shader, but I'm running into issues with transparency. My SubViewport has transparent_bg enabled, yet it seems the alpha channel is lost when processing the fragment shader (always 1.0), and I end up with a black screen with some text that has very opaque chromatic aberration. I'm using the Forward+ renderer.
Desired effect (without transparent_bg enabled. the transparency shown is just the editor preview):
Actual effect (with transparent_bg enabled):
Appearance in-game (left side is the screen-reading shader)
Minimal reproduction project: