Is it possible to to apply a shader to all of the sprites in a scene as if they were one texture?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By grayduck

I am working on a 2D game in Godot (3.2.3), and I would like to use shaders to modify my sprites–flash on taking damage, green tint when poisoned, etc. On the surface this seems seems pretty straightforward, and it would be if each of my objects only used a single sprite node. But many of them use 2 or 3 for animation flexibility, e.g. a turrent with separate sprites for the base and the gun itself. At best, this means I would have to apply the shader separately to each sprite, which results in a lot of messy bookkeeping and is prone to errors. At worst, it doesn’t work at all, like if I wanted to display a single outline around a whole multi-sprite object.

I’ve seen some forum posts that say this isn’t possible, it’s just a limitation of Godot, but those are at least a couple of years old. I’ve also seen a couple of posts ([1], [2]) about using a combination of BackBufferCopy and TextureRect nodes to do roughly what I’m trying to do, but it seems like that method applies the shader to anything that has been rendered at the time it runs–so the shader needs to be able to discriminate foreground from background, and applying it to more than one object would cause problems.

So is there any way to prerender a group of sprites so that I can run a shader on the group as a whole? Or is this still a dead end?