Strange behavior between DirectionalLight and Orthogonal Camera

Godot Version

4.0

Question

Greetings, I’m experiencing this strange behavior using the Orthogonal Camera and DirectionalLight. At certain Y Levels, the camera shows this really harsh beam of light at the center. (I am using the PhantomCamera plugin so the camera can follow my cursor)

I have attached four images, one is the in game look with the harsh light beam. The other is the editor look (the expected look).

My Camera3D has a script that simply sets it to orthogonal mode with a negative near_z parameter to avoid clipping like this:

self.set_orthogonal(15, -1000, 2000)

Setting the near_z to a positive small number still shows the light beam with clipping.

Modifying the far_z parameter to a large positive number still shows the light beam

The PhantomCamera has an offset parameter I can modify. If I increase the Y offset, the harsh light beam stops appearing, however, the shadows are not visible. It seems that whenever this lightbeam exists in the game world, shadows stop existing, they also seem to flicker. If I change the camera to perspective, my game doesn’t really work well as it was made with Ortho in mind, BUT the shadows are present and the light beam is nowhere to be found.

Anyone have any ideas as to what might be the issue? Any help is greatly appreciated

I suggest upgrading to Godot 4.2, as 4.0 is pretty much end-of-life by now.

Also, if you need to adjust specular light on a DirectionalLight3D, you can use its Specular property since Godot 4.2 (you may want to decrease it to 0.2 or so in your case).

Regarding shadows, decrease the Camera3D’s Far property to a lower value like 200, as shadow distance is based on the Camera3D’s Far property when in orthogonal mode.

1 Like

Thank you, it seems the update just fixed the issue entirely, the white beam of light was fixed with another method, however. Giving a spring arm a shape fixed the beam of light.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.