I'm trying to get lighting to work in a small scene. Originally, this scene of a maze was build with 1 unit high walls. But then to get the physics to work better, I shrunk everything down to be 0.1 times its original size. Now the physics is okay, but the shadows cast by lights are wrong. There are huge gaps between the walls casting the shadows and the actual shadow. Is there a way to fix this?


Original scene with 1 unit high walls


Shrunk scene with 0.1 unit high walls


Scene with unit cube for comparison

It's best to use real world units, as everything is based on that (the physics, the lighting, shadows, etc.).

I would hope 10 cm counts as real world physics. Most of the objects we deal with every day are that size. It's not like I'm trying to create a microscopic environment.

Okay, try setting the shadow max distance to a small value like 1 which would be 1 meter.

That didn't work. The shadow disappears entirely for any value less than 20. And for any value, there is still that gap between the bottom of the shadow and the wall. Max Distance just changes the blurriness of it.

To be honest, the shadows in Godot 3.x are kind of limited. Particularly they don't work for small objects very well. There are ways to tweak things, but you have to really mess with all the settings. I think putting normal bias on 0.0 helps, and then you have to adjust everything else to smaller numbers. But it still won't be perfect.

floating point precision can definitely become an issue, among other things, the depth buffer.

Casting a shadow onto a plane from a wall 0.1m high and only 0.05m thick, I got decent results from these changes. Just bands across the surface when the light is nearly horizontal:

Directional Shadow:
Normal Bias = 0.0

Light / Shadow
Bias = 0.05

There is no such thing as good results from Godot 3's shadows out of the box, so I think it just needed tweaking. 🙂

    Yeah, there's always a gap. That is a limitation of Godot 3.x. They fixed this in 4.0.