How to make 3D shadows look good?

Godot Version

4.3

Question

I’ve been struggling with making 3D shadows look right in Godot. I’ve tried playing with various settings both on the lights, the world environment and the project settings. So finally in frustration, I just setup a simple scene consisting of 2 meshes (a plane and a box), a directional light (at 30 degrees), a camera and a world environment. I’ve left all settings on their defaults for all the nodes as well as the project and these are the results:

Why is the shadow offset from the object?

Increasing the Soft Shadow Filter Quality in the settings to “Soft Ultra” makes the effect even worse:

Decreasing it to “Hard” sort of improves it but comes at the cost of the shadow being completely pixelated:

Doubling the “Size” of the shadow does very little to improve this it seems.

What settings can I use to improve shadow rendering?

1 Like

Hi!

The shadow offset is tweaked by the bias setting on the directional light, tweak it together with normal bias if needed. The directional light also carries settings for the blur and opacity etc.

For general shadow quality tweaking, the main settings you should look into are in Project Settings → Rendering → Lights and Shadows → Size. This sets the size of the shadow texture used for all of the shadows, if this is too low it is much harder to get really good shadows. Another setting you should change together with this, is the Max Distance setting on your directional light, the smaller the distance, the fewer shadows are using the shadow texture, making them higher res.
Basically higher shadow size is better, and try to get the Max Distance as low as possible (depends a lot on your game).

Also depending on your game you might want to switch the directional shadow mode on the directional light, to allow for lower res shadows at further distances.

Hope this helps!

4 Likes