PorkStudios / FarPlaneTwo

Level-of-Detail renderer in Minecraft. Allows for render distances of millions of blocks. (Cubic Chunks-compatible) (WIP)
https://daporkchop.net/
Other
1.45k stars 50 forks source link

LODs not rendering in corners of render distance (with fog enabled in Optifine) #95

Open MrBenjaminBowman opened 3 years ago

MrBenjaminBowman commented 3 years ago

With Optifine on, render distance seems to be circular, while the LODs display in a box around the player, leaving a gap in the corners. Issue is more apparent on larger render distances. Issue may bias in the -X, -Z direction? Corner chunks render in properly without Optifine.

Pictures ### 8 render distance ![2021-08-19_10 14 10](https://user-images.githubusercontent.com/40965491/130085424-1bd5444f-28f4-4e02-95f3-64c32d292d39.png) ![2021-08-19_10 14 12](https://user-images.githubusercontent.com/40965491/130085808-e888b0d6-d9db-4ffa-8fb3-35027ceb2010.png) ![2021-08-19_10 14 14](https://user-images.githubusercontent.com/40965491/130085818-cffaa3d1-27b7-40cf-b7d6-24527ec35310.png) ### 12 render distance ![2021-08-19_10 15 30](https://user-images.githubusercontent.com/40965491/130085697-77848131-7024-44ec-a77b-bb51360302f6.png) ![2021-08-19_10 15 32](https://user-images.githubusercontent.com/40965491/130085704-f6b879b2-0774-4167-b251-fbffa8b7227c.png) ![2021-08-19_10 15 34](https://user-images.githubusercontent.com/40965491/130085714-62b1676d-3639-466b-9793-0b4b66d0254c.png) ### Without Optifine ![2021-08-19_10 25 01](https://user-images.githubusercontent.com/40965491/130086007-14037989-fc1e-4cdd-9a83-005f880cd2ae.png)
DaMatrix commented 3 years ago

that's quite odd: i test almost exclusively with OptiFine and don't think i've ever noticed anything like that before. does it resolve itself if you look directly at the corners using OptiFine's zoom feature?

MrBenjaminBowman commented 3 years ago

Nope, zooming doesn't affect result. Here's a video of the issue if it helps:

https://user-images.githubusercontent.com/40965491/130245354-e4729351-1ffd-46b6-87a3-832b2b7178d6.mp4

Tried resetting video settings to default, still happens. Using latest version of Optifine (HD U G5)

MrBenjaminBowman commented 3 years ago

Without FP2, Optifine does render the corners of the render distance.

Pic ![2021-08-20_10 35 35](https://user-images.githubusercontent.com/40965491/130250591-9069a1df-7d58-48f6-8309-882419fd8499.png)
Jakub-Wilk commented 3 years ago

I'm able to reproduce, with better detail

Basically, Optifine's render distance is still square, but it loads chunks in a circular fashion, and it takes quite a long time (a couple of minutes on a ryzen 3600 with a render distance of 20) to actually fill the whole render distance, so it makes it seem as if the render distance is circular.

When the whole render distance is filled, FP2 correctly displays the LODs, with no holes.

However, while the render distance is still loading, FP2 unloads the LODs before the chunks are actually generated, which leaves holes in the ground.

Because of how long it takes to actually load all the chunks it creates the illusion of a circular render distance.

Here's a video of it (YT because file size), it illustrates the situation pretty clearly. You can see how it loads chunks pretty fast for a while, then it stops loading, and then it slowly loads the rest.

On lower render distances it looks like the corners aren't loading because the area of slow loading chunks is just on the border of the render distance.

2021-08-22_04 46 37 2021-08-22_04 50 15

MrBenjaminBowman commented 3 years ago

I went on to do more testing, but when I got on today, the problem seemed to have fixed itself. I reset my video settings again, and the problem came back. Just found the issue! Having Fog set to anything but Off creates the issue.

https://user-images.githubusercontent.com/40965491/130341519-942feea0-ae99-4104-9334-f7e8c1faf95f.mp4

Jakub-Wilk commented 3 years ago

Does terrain generate in the holes if you wait a couple minutes?

MrBenjaminBowman commented 3 years ago

Does terrain generate in the holes if you wait a couple minutes?

The holes remained regardless of time waited and render distance. Fog seemed to be the issue, turning fog off fixes the corners and they generate normally.

MrDodojo commented 3 years ago

This makes sense, I think optifine might save the corner chunks from rendering because you're not able to see them with fog on anyway

DaMatrix commented 3 years ago

alright, that makes a lot more sense - i've only tested a few times with fog enabled.

DaMatrix commented 3 years ago

does this still occur using the latest jar from dev/gpu-frustum-culling?

MrBenjaminBowman commented 3 years ago

Using latest from dev/gpu-frustum-culling, corner chunks still initially unload when toggling fog to fast/fancy. Chunks and LOD only load properly in the direction the player moves.

https://user-images.githubusercontent.com/40965491/130481923-d9838382-151f-488c-a220-fb411e5214ae.mp4

Also, I had the game paused in the background while typing this, and it closed itself with exitcode -1073740791.