-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange bug in light spreading #1190
Comments
This isn't anything new. Minetest is known to have some lighting bugs, which are hard to fix. The nicest way to fix this would be to have the client dynamically generate lighting using hardware lighting. This would raise the system requirements a bit though... |
We should make it an option though, so people with very bad machines (like mine :)) can disable it, although this could break the engine into two pieces IMHO (if i remember things from my first trail to 3D right) |
But how does work current lighting? Is it recalculated each frame? |
The problem is, hardware lighting is likely to behave differently, so it could be weird if you play multiplayer. The other problem is code duplication, indeed.
No, it's pre-computed, using sky light (sun, moon) and block light (torch, lava) values. |
current lighting is even more a performance killer then dynamic lighting would be (at least for somehow modern gpus). I've seen this on android where light calculation is topmost cpu hog |
@sapier hardware lighting wouldnt help, we still need to calculate it the old way for e.g. get_node_light(). |
afaik those shadows are caused by invisible caves that are generated in the sky... |
This should be considered a blocker. It looks horrible and is very hard to fix in-game, without worldedit of course. It makes minetest look bad to a first time user. @RealBadAngel I remember paramat discussing these invisible caves with hmmm in a pull request at some point. I wonder if cave generation could be rewritten to help solve this bug? |
The screenshot seems to show shadows occuring along a mapchunk edge, the shadow shapes look like the shadows of edges of large caves that extend beyond a mapchunks edge. Sometimes the large caves cause bugs and this my be one of them. |
That's unfortunate. These lighting artifacts make minetest look a bit unpolished. |
These do seem to be more common lately, but I may be imagining it |
This sorta thing happened to me after mapgen once and it was kinda annoying because it happened right above my farm. |
Mgv6 does not have a heightmap generated during mapgen, if i add one it would stop large caves being generate above ground, which might fix these shadows, i'll see what i can do. |
^I hope it works, these shadows are a very old bug. |
I can still remember this being posted as a bug, and someone thought the sun was casting a shadow. That seems pretty hillarious now. Anyway, I also really hope this gets fixed. Maybe minetest should update nearby chunk's lighting every few minutes? This would fix the problem, maybe... |
Heightmap will not fix this, i will try reducing the size of large caves so they do not extend beyond the mapchunk borders. |
Why do invisible caves cause lighting bugs anyway? I looked at the lighting code a fair bit when I was optimising it and can't recall anything that would indicate that a cave should cause lighting changes. |
@Zeno- Yeah, it's like air has a shadow now. |
@Zeno- I think it's just a theory. |
Yeah it's weird. These shadows are now very common, possibly due to changes made by hmmmm to lighting code while fixing dark nodes at y = 47. These shadows run along the edges of mapchunks so like floaty dungeons seem to be an overgeneration problem. |
Weird fact: flying up and down above a shadow and watching the lighting of the wieldhand, the dark air always changes to bright air above y = 30. Editing the core code to control caves, it seems the shadows are created by large caves and not small caves. By placing cave air as water, as RBA did, large caves are certainly generated high above ground, and their edges cause the shadow bugs. After more experimentation i can confirm these shadows are caused by the edges of large caves that are overgenerated into the ignore nodes of neighbouring not-yet-generated mapchunks. By stopping large cave air nodes replacing ignore nodes the shadows are fixed, but long flat walls appear in the terrian because large caves at the surface help to shape the terrain. |
This is the best i can do and seems to work well, comments? #2410 |
#2410 is now merged, hopefully there will now be far fewer shadow bugs, i couldn't find any during testing, although i expect them to still occasionally appear. Preventing large caves being generated above ground will also improve mapgen speed. Needs testing by others before issue is closed. |
No feedback, seems to be successful so closing. |
I haven't seen these sky shadows ever since the heightmap addition. Thank you so much! |
You can download world here http://www.filehosting.org/file/details/444029/Test.tar.gz
The text was updated successfully, but these errors were encountered: