+2 votes

I have a 3D game with a large amount of procedurally generated geometry in the scene, so if I enable dynamic sunlight shadows, it halves FPS because the engine has to render the scene twice (for the shadow map).

However, sunlight moves very slowly, so I think the shadow map should not be recalculated on every frame, right? Can we "bake" them while the game runs and ask to update manually?
Also, only a small portion of close-range elements could be updated quicker than elements that are far away.

Which are possible shadow optimizations for large scenes in Godot?

in Engine by (27,820 points)

1 Answer

+2 votes

There is a way to use baked light instead of using realtime shadow.
see this to know how to do it.
https://www.youtube.com/watch?v=UXFXTgy439s
This will make shadow looks better and increase performance,
but it' will make scn file very large.

You have multiple options to optimize realtime shadow rendering.

Setting Max Distance of DirectionalLight, instead of 0 value.
This will make shadow looks better and increase performance for large scene.

Turning off Cast Shadow of terrain mesh.
This is on by default.

Setting Shadow Filter to none at Scene > Project Settings > Rasterizer.
Try another options of shadow filter. :)

by (9,694 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 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 webmaster@godotengine.org with your username.