I'm trying to light up the top of a wall, while still using that wall as an occluder to cast shadows

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

I’m trying to light up the top of a wall, while still using that wall as an occluder to cast shadows. I’ve included a picture of the results I have so far. If you notice the bottom left wall you can see the result I’m looking to achieve (with the wall lit up), but then the shadow doesn’t cast right from the corner. Is there a way to achieve a lit up wall AND have shadows cast properly?

Thanks in advance.

:bust_in_silhouette: Reply From: astrale-sharp

Hey, hope this will help even though I am not utra comfortable with lights
My basic idea with this would be to having tour wall being lit normally and not casting shadows at all + another object typically as a child of the wall that would copy its shape and be used only as shadow cast
Other comments may prove more straightforward :wink:

:bust_in_silhouette: Reply From: A112Studio

To give the shadows that nice, soft edge look set the variables filter, filter smooth, and gradient length under Light2D shadow section. Godot supports Percentage Closer Filtering (PCF), which takes multiple samples of the shadow map around a pixel and blurs them to create a smooth shadow effect. The higher the number of samples the smoother the shadow will look, but the slower it will run. But beware, it takes lots of tweaking to find the perfect result :wink: