Frustum culling can rarely change the draw order of render regions
douira opened this issue ยท 4 comments
Bug Description
The render order is wrong in this situation which leads to sorting artifacts. Since the artifacts go away with camera angle, it's not a normal translucency sorting problem.
Reproduction Steps
- Make a world with seed
-1209221951706518130
, RD 2 is enough. According to @Lolothepro, it needs FOV <= 71 - Run
/execute in minecraft:overworld run tp @s -2091.80 82.74 -1928.06 47.84 23.10
- Observe a line in the ice near the bottom of the screen
- Run
/execute in minecraft:overworld run tp @s -2091.80 82.74 -1928.06 50.54 25.80
- Observe the line disappear
The tp commands only differ in camera facing.
Log File
Crash Report
Clarification so that the next person isn't unable to reproduce for 5 minutes: in the third step, you just need to turn your head, not actually move the player. ๐
The problem is that regions are only enqueued when a chunk section is visible... This means if a chunk section is skipped due to frustum checks, it will not update the ordering of regions, and in the edge case demonstrated here, will break things.
The solution is trivial (update the regions list before failing any chunk sections) but it will require some minor code refactoring.
Fixed with 27e531f.