Directional Light - Max Distance working in Editor but not in Camera View?

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

Hey everyone,

I was experimenting with 3d lighting and having this issue. I have a directional light and a long tunnel, that is supposed to be completely dark. The end of the tunnel wasn’t dark so I increased Max Distance in the Directional Shadow property on the Directional Light.

However this only seems to work in the editor, not in the actual view from the camera. Am I missing something here?

:bust_in_silhouette: Reply From: Calinou

This is because DirectionalLight’s maximum shadow distance is clamped by the camera’s Far clip distance. Increase the Camera’s Far property to a value like 4000 solve the issue. If you get Z-fighting in the distance, increase the Near property as well (try 0.1 or even 0.2).

In Godot 3.x, Far clip distance values above 4000 may break SSAO rendering and are not recommended.

Ahh I see. I tought I tried changing the camera properties but looks like I somehow missed it.
Much appreciated, thanks.

Fjcxv21 | 2021-06-14 21:59