Is it possible to use or possibly tweak this plugin to achieve something like that? Perhaps a list where you specify what layers to affect.
I'm not sure if there are easier ways to get to these results. However, pixel shader have only access to the current objects layer or the background (meaning everything rendered so far). The reason for this is, that a pixel shader is at the far end of the production line. When it comes to rendering the scene, a shader is called for every object such a shader is applied to. It will always render to a display size texture.
Imagine you have three sprites "A", "B" and "C", in that order ("A" lowest, "C" highest) and the layout set to the color black. Every sprite is given an effect. When the scene is rendered, it starts with a display size texture set to the color black. Now sprite "A" is about to be rendered, so its effect is called. The result of the effect is rendered to its own texture in display size. Now the first texture and the second one are merged to the first one. Sprite "B" is now about to render, the same way as sprite "A". And it repeats for sprite "C". Finally the texture with all the other textures merged to is passed as output.
If you would have had two layers, with "B" and "C" on layer 2 and instead of two effects for "B" and "C" you would have applied one effect to layer 2, then it would only do the black texture, sprite "A" texture and the layer 2 texture.
A pixel shader gets a texture to work on, but isn't aware of the z-position of that texture or how many textures there might be.
That said there might be a way with an altered version of 'Color Fusion (Masked)', but that would be a huge load for the gpu. I'm talking about 'keying'. It's something heavily used in films (look for the keywords "green screen", "blue screen", "chroma key", etc), but it is a post effect that uses a lot of processor power. It would be possible to enhance CF(M) in a way that it ignores a certain color and recolors and masks only those areas without that color. You would then setup your scene with a one-colored background instead of the starfield. Another layer above CF(M) would contain the starfield and an effect that replaces the key color areas with the starfield while showing the scene instead of the starfield where no key color is.
A full HD game with two such effects might require a powerful graphics card...
so, to the experienced constructors: Is there an easier way?