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
L-system lighting bug #3421
Comments
👍 Good work tracking that down. Here's hoping ... |
Unfortunately testing 0 up 2 down overgen i find many bugs at y = 47, 16x16 areas of stone where biomegen has failed, and ores in sand. |
Re-opening as this is useful information on the moretrees lighting bug. |
Mgv7 For a while the advice has been to use the moretrees option to place all trees as saplings that grow by ABM long after mapgen, ensuring the mapchunk above has been generated. This almost solves the lighting bugs but subtle (1 light level darker than it should be) shadows remain in water: The water shadow is aligned to mapblock edges, so must be the area processed by l-system tree generation. This shadow is 48 nodes wide, which is the area emerged by l-system code. This subtle shadow is also present when moretrees is used in the default mode of generating trees at mapgen time when generating world by flying near the clouds to ensure the upper mapchunks are generated first. |
Mgv6 Subtle shadows are present in mgv6, using moretrees in the default mode of generating trees at mapgen. The pattern seems more variable, but is still aligned to mapblock edges. In the lower screenshot there is an area at the bottom without trees but still with a shadow. These shadows occur even if i fly high to generate the higher mapchunks first. The subtle shadows in water are present in moretrees 'sapling' mode too, either travelling at ground level or flying high to generate higher mapchunks first. |
We can split this issue into 2 now:
|
#4967 merged. |
This issue is to document some progress i made tracking down shadow bugs.
Same issue as #3455
Possibly related issues #3430 #3839
Working on my 'fracture' lua mapgen mod i noticed lighting bugs in mgv7 not present in mgv6 or singlenode. The difference is mgv7 uses 1 up 1 down overgeneration while mgv6 and singlenode do not. I solved the lighting bug in 'fracture' by calculating lighting over the entire overgenerated volume instead of just the mapchunk:
vm:calc_lighting({x = x0, y = y0 - 1, z = z0}, {x = x1, y = y1 + 1, z = z1})
I then thought about how 'moretrees' mod has shadow bugs in mgv7 and not in mgv6 and suspected that the overgeneration of mgv7 was incompatible with 'updateLighting' used by l-system tree generation. Studying the code, l-system tree code automatically emerges a large volume that probably touches the mapchunk top, when propagating sunlight into that volume it looks at the single layer of nodes just above the volume, which in mgv7 would often be the single layer of overgenerated nodes above a mapchunk, instead of 'ignore' in mgv6.
I noticed the moretrees shadow bugs were dependent on whether the mapchunk above had been generated first. 'updateLighting' was probably lookng at the lowest mapblock in the mapchunk above. If this was generated and full of sunlight no shadow bug. If it was ungenerated and therefore mostly full of 'ignore' but with a single layer of overgenerated nodes as it's lowest layer the shadow bugs occured.
I created a branch with a version of mgv7 without overgeneration and tried the moretrees mod, the more extreme shadows were fixed. Overgeneration is essential to avoid discontinuities at mapchunk borders, so i am currently testing a '0 up 2 down' overgeneration which so far seems to fix the more extreme shadow bugs, however it needs testing to see if the advantages of overgeneration remain. The '0 up' means the top of the generated volume now aligns with mapblock edges just as in mgv6, hopefully fixing the bug when propagating sunlight down.
Because the placement of schematics also uses 'updateLighting' the shadow bugs related to schematic placement may also be fixed by this method.
The text was updated successfully, but these errors were encountered: