How can i replicate this Fog of War / Vision effect from Darkwood?

Godot Version

4.2

Question

Hey, there is this Unity tutorial i saw for the effect i want

How can i replicate this in Godot? All “Fog of War” tutorials i’ve seen so far don’t have the effect i need.

I found only one outdated tutorial about this: https://www.youtube.com/watch?v=Q57H2fAg-aw

They removed light masking in 4.0, but there is a workaround.

For anyone asking how to do this in Godot 4.x I think I’ve found the solution:

The items that you want to be masked (IE: the other characters) need a material of type CanvasItemMaterial. Set the Blend Mode to Mix, and the Light mode to Light Only. Make sure that your light source has shadows enabled, is also set to Mix, and uses transparency instead of a black background.

It took me most of an afternoon to figure this out, so hopefully I’m saving someone else some trouble!

image

Now the problem is that i can’t combine light sources because they will start masking the enemies the same way that the player’s LOS does.

image

Adding a CanvasItemMaterial to the LightSources i want to hide doesnt mask them at all.