How to _draw overlapping polygones without adding alpha together

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

As shown in the image below.
I’m trying to use

for i in walls: draw_colored_polygon()

inside one main control node to create wall shadows i.e. fog of war. It works fine for regular walls that use a black color with a full alpha of 1.0.
The windows however should be transparent and only modulate the color behind it a bit.
My problem here is that many windows behind one another add the polygons together and create many seams where they overlap. It is realistic in that windows get harder to see through the more are behind one another but it also creates a fish eye effect when you walk along and see the seems moving along, kind of sickness inducing, so i need it gone.

Long story short,
is there a way of forcing all the

draw_colored_polygon()

in _draw() to keep alpha at 0.18 even if they overlap?

I tried

draw_colored_polygon( Color(1,1,1) )

and then modulate the control node with self_modulate but it has the same effect as just drawing the polygones with a transparent color.

To clarify all draw calls are done in one control nodes _draw() function.

It doesn’t add the alpha together, it draws on top of it. If you don’t want that effect you will need to calc where the polys overlap and clip it

beaverusiv | 2021-04-03 19:54