I have a CanvasLayer singleton that I am using for transition effects between scenes in my game. This CavasLayer contains a screen-sized ColorRect child with a shader (canvas_type unshaded) that does various screen wipes when its uniforms are animated using an AnimationPlayer. This shader changes the COLOR of the screen depending on the values of its uniforms.

I also have a CRT shader (canvas_Type unshaded) that I want to use in my game, at the same time that these screen transition effects are taking place.

I tried to add another ColorRect to my CanvasLayer, this time with the CRT shader on it, higher in the heierarchy than the other ColorRect I am using for the screen transitions.

Unfortunately, because both shaders change COLOR, the shader lower in the hierarchy always cancels out the shader higher up. Basically, only one shader can work at a time.

Is there a way to stack shaders using ColorRects similar to the way I've been trying?

If not, what's an alternative solution?

I really like the idea of keeping my shaders separate depending on what they do. I don't want to combine them into a single shader if it can be avoided.

Please note that I also asked this question in a Godot forum, but figured I might have better luck getting it answered here.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.