I have many sprites, all of which are mostly transparent, except for the edges. I want to overlap them, but I don't want to show what's underneath the top one - Here are some examples of what I mean:

Notice that the parts of the red squares that are inside the green ones aren't shown, yet the background still is. Assume that if the red squares were on top, they would mask the green ones instead. I would only want this to occur between instances that have the same texture. How can I achieve this effect in Godot?