mojira.dev
MC-70850

False negatives during occlusion culling

The bug

The occlusion culling occasionally fails to identify chunks which should be visible.

How to reproduce

Test world

Download and open this world:

[media]

Natural generation

  1. Create a normal 1.8 world with the seed -8057776351348801925

  2. /tp -271 97 -1358
    → There will be a missing chunk in the chasm.

[media]
  1. .

  2. /tp -273 93 -1360
    → There will be a missing chunk directly beneath and slightly to the side of the player.

[media]
  1. .

More examples:

Seed: -3040140397380042098
Coordinates:

/execute in minecraft:overworld run tp @s 83.90 79.00 69.69 -67.35 30.15
/execute in minecraft:overworld run tp @s 79.81 14.00 41.47 -859.83 7.65

Code analysis

See this comment.

Linked issues

Attachments

Comments 33

Confirmed.
Some findings:

  • Indenependent of the render chunk width

  • when moving a few pixel to the right, the bottom of the chasm renders

Nathan Gilbert

This issue is still present in 1.9.4

With the information provided in MC-109862 I was able to track down the issue a little bit.
I attached a world download to reproduce this issue.
It does only appear if the one wall of a section is fully filled with blocks (iron blocks in the world download) and the wall of the next section has at least one gap in it (lapis blocks in the world download).

[media]

Also it should be noted that the facing of the player has an impact on it. E.g. in the seed and position provided in MC-109862 it only occurs if the vertical facing is less than -34.3.

I can confirm this issue for 16w44a and 1.11-pre1.

Can confirm for 1.11

Michael Kreitzer

I found a cause and a fix for Panda's test world. However, it doesn't seem to cover all cases.

 
While walking the visibility graph it won't add a neighbor subchunk if there's no visibility path from the direction the algorithm entered the subchunk to the direction of the neighboring subchunk. When it got to the chunk with the iron blocks from the subchunk below the player (which is the 2nd subchunk processed) while there was no lapis block, it would end there. There's no path to any neighbor due to the solid wall of iron blocks at the direction the path "entered".
 
The only other paths to the disappearing subchunks are the subchunks to the right and left of the player. The problem is, the algorithm was setup in such a way that once a path moves in a certain direction, it could never go back in the opposite direction, ever. So, take e.g. the left. From the player it would go left (now it can never go right again), down (now it can never go up again), forward (now it can never go back again), forward, and forward. So, in this entire scene with all subchunks above the bottom two out of the Frustum, there's no valid path to those two subchunks that disappear.
 
When you placed a block to fill the lapis wall, it blocks the down, forward path. Now, the path is straightforward; forward, down, forward, foward, forward, and it spreads from there.
If you clear the inherited direction restriction, it clears up this test case nicely, and in some brief real world testing it seemed to cause no significant increase in subchunks rendered or any appreciable drops in FPS. I'm attaching a screenshot from MCP 9.42 (I know.. old.. sorry I do not have anything newer setup). I renamed a lot of the variables to help make things clearer.
 
Now, as for the test case that still fails:

-1288030513686422296
/tp -254 81 480

(edit: this seed came from a 1.12.2 test world.. if somebody with a more current dev environment can confirm any of this it'd be much appreciated)
 
I'm going to try to find a synthetic/controlled case for this one. I suspect that "bidirectional" path requirement is related, and possibly unnecessary. I'll play with the idea of neighbors only caring if they can see each other.

[media]
23 more comments

Can confirm in 21w03a.

Can confirm in 21w05b.

Can confirm in 21w06a.

Can confirm in 21w07a.

This issue seems to have reappeared in 1.19.2 or may have never been properly fixed, so I've created a new ticket regarding this which can be found at MC-255750.

Kevin Howe

mgatland

Confirmed

Important

Rendering

chunk, culling, rendering

Minecraft 14w30a, Minecraft 1.8, Minecraft 1.8.8, Minecraft 15w49b, Minecraft 1.10.2, ..., 21w05b, 21w06a, 21w07a, 21w08b, 21w10a

21w11a

Retrieved