0 votes

In a 3D scene, I tried to put 2 directional lights with the shadows activated.

Each works well separately (i see the shadows), but as soon as both are visible, only the shadows of the first directional light in the scene tree are visible.

Is this normal ?

PS I did not find in the documentation (maybe I searched wrong...) anything indicating that the number of directional lights was limited.

Godot version Godot version 3.4.4
in Engine by (16 points)

For reference, this was cross-posted on the Godot forums: https://godotforums.org/discussion/29906/multiple-directional-lights-in-3d

1 Answer

+1 vote

Cross-posting my answer from Godot forums for posterity:

Godot 3.x only supports one DirectionalLight with shadows at a time.

In Godot 4.0, using more than 1 DirectionalLight will always have a significant performance impact, especially if shadows are enabled on more than 1 DirectionalLight. Doing so will also worsen shadow quality, as the shadow map texture will have to be shared for multiple DirectionalLights.

As a conclusion, in Godot 4.0, even if it doesn't look physically accurate for your game, I strongly recommend sticking to 1 DirectionalLight for best performance and quality.

PS: OmniLights with shadows are not intended to be used as a replacement for DirectionalLights. You could increase the shadow atlas size (or use a distant SpotLight instead), but it will never look ideal since there is only one shadow "split" to speak of.

by (12,441 points)
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 Frequently asked questions and 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 [email protected] with your username.