Godot Version
4.3
Question
How to mask top down shadows?
Let’s say I have a foreground (white in this picture) and a background (grey). I have some shadows on a CanvasLayer or something and I only want the shadows to appear on the white foreground. The grey background should not have shadows.
A couple of tempting solutions is to make a shader that detects white, but the foreground might not be plain white, it might be a sprite. It might even have some of the same colors as the background.
Another tempting solution would be to make the z-index of the background higher than that of the shadows, and “cut it out” of the foreground. But this is no good if the foreground and background are moving at different speeds.
