Meldexun / Nothirium

34 stars 6 forks source link

Chunks become invisible when camera Y level is above 270 or below 0 #48

Closed yezhiyi9670 closed 1 year ago

yezhiyi9670 commented 1 year ago

Describe the bug Many chunks become invisible when camera Y level is above 270 or below 0 due to broken culling.

Reproducibility

To Reproduce

  1. Open any world.
  2. Change render distance to 16 or higher in order to make the issue obvious.
  3. Get to high Y level by executing /tp @s ~ 270 ~.
  4. Fly up by a little bit.
    ❎ The terrain below become suddenly invisible.
  5. Get below 0 by executing /tp @s ~ -10 ~.
  6. Fly around. ❎ Only the chunk above the player's position will show. There may be a chance that chunks flicker.

Screenshots/Videos

2022-12-27_11 03 50

2022-12-27_11 03 30

Versions Nothirium: 1.12.2-0.1.10-beta RenderLib: 1.12.2-1.1.10 Forge: 14.23.5.2860 Minecraft: 1.12.2 Other mods (necessary to reproduce the bug): .mixinbooter-7.0.jar, [___MixinCompat-0.8___].jar

Hardware CPU: AMD Ryzen7 4800H RAM: 24GB GPU: NVIDIA GeForce RTX2060 with Max-Q Design (also tested: AMD Radeon(TM) Graphics) VRAM: 6GB

Log File latest.log

Technical Info It's found that the issue is gone if I void the isVisibleFromAnyOrigin method in AbstractRenderChunk.java.

    public boolean isVisibleFromAnyOrigin(Direction direction) {
        // return (visibleDirections & (1 << direction.ordinal())) != 0;
        return true;
    }
Meldexun commented 1 year ago

Should be fixed in 1.12.2-0.2.1-beta