Hi everyone! I’m new to Godot and have a strange issue with the 3D lighting.
So I have created procedural terrain generation for a game I’m making and included a day and night cycle. I’ve been having several weird lighting bugs and there is one in particular I’d like to address here.
Half of my screen is light, and the other is dark. This is especially visible during the night in my game. It is supposed to be dark everywhere but here is the result.
Don’t really use 3D, but maybe the problem is that (from what I can tell) the world you created is very big, which might cause the engine to sort of optimize the lighting and not light places in the distance, only focusing on nearby surfaces. Another (more likely) reason is that you have not turned up the brightness or distance of the light enough to reach the dark areas.
I noticed this even earlier before I noticed it largely with the day and night cycle. It’s like half of my screen in particular sometimes has this. Yes, the render distance for my game is massive thanks to the performance optimizations. Godot doesn’t have a proper way to set up fog in the distance unless there is a shader or runaround. I’m not sure how I can raise the render distance high enough to cover everything. The game world is infinite but the render distance can vary depending on what settings I’m running. Usually 30 to 200 chunks are in view. As I move around with the camera the bright areas suddenly turn as dark as they should. So it must have something to do with the render distance of the lighting. I’m just not sure how to change it.
Heya! just popping here to say that this also might be issue with how your light is set, If you’re using DirectionaLight3D it might be possible that you have your settings on it configured wrong, for example you can set it like this and see if it helps(Mainly Directional Shadow -> Max Distance):
Max distance seems to work but I remember there being some issues with high max distance too. I’ll let you know if there are any other issues.
I prefer that I use my code since what I’m doing with my terrain is incredibly niche case and unique. I don’t think any add-ons fix exactly what I’m going for. I believe I am combining all of the chunks into one giant mesh. I’m using an array mesh to combine it so that’s probably the issue. I mean it isn’t that big of a deal. If I have to I’ll just disable shadows or fine another run around.
Indeed there can be, Its called Light Leaking, it happens when the light shines (leaks) through the mesh, easy way to fix it is have your mesh double sided, but that costs perfomance, I am sure that there are more ways on how to fix that, but youll need to search for that if that happens.
Light leaking was an issue but I have that under control and maybe even fixed it. Max distance does make the shadows pan out so I’ll need to mess around with the bias to fix that but yeah it fixed the issue basically. Thanks! If you’re wondering I’m basically making a terrain engine that will look similar to Lego Worlds. The blocks will be quite unique since they will look similar to lego blocks just without the lego logo or exact aesthetic.