Godot Version
Godot 4.3
Question
How to fix jittery shadows from the day and night cycle?
Hi! I’m back again with another lighting issue. This time with the new day and night cycle I implemented. I did end up splitting my giant procedurally generated world into chunks by mesh instead of having the entire world into one big mesh. That seems to have fixed all of my previous lighting woes except this one.
I have a video to share. I’m pretty sure it is either my day and night cycle calculations causing this or I need to tweak settings in Godot. I’ve messed around with bias but if I turn bias up too much only the large shadows show and I’d prefer to have all the shadows visible if possible.
I found another post about this issue and the solution was related to how the sun’s rotation angle was specifically the linear interpolation. I can share my code of how I’m doing it and you can leave your suggestions.
func _process(delta: float) -> void:
time_of_day += delta / day_length
if time_of_day > 1.0:
time_of_day = 0
var sun_angle = lerp(0, 360, time_of_day) - 180
rotation_degrees.x = sun_angle
I’m new to the forum and also Godot itself, so if I messed up on formatting the code, let me know how to do it properly in the future.
Here is a link to an unlisted YouTube video about the problem.
[https://www.youtube.com/watch?v=TXGBhv_9_5s](Jittery Shadows Bug Video)