0 votes

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.

https://imgur.com/a/YReO71M

Godot version 3.2.3
in Engine by (161 points)
edited by

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

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.