nvidium icon indicating copy to clipboard operation
nvidium copied to clipboard

Strange rendering artifacts at far distances

Open flipfloppy1 opened this issue 2 years ago • 9 comments

2023-09-30_19 41 15 2023-09-30_20 27 52

May be related to the block culling conflict mentioned earlier, but that's just an unfounded hunch. #48

Found with Sodium 0.5.3 and Nvidium 0.2.0 on Minecraft 1.20.1. The rendering artifacts get worse the further away the terrain is, until there are visible black splotches along the horizon.

https://github.com/MCRcortex/nvidium/assets/71437157/f9741b0c-b1bd-45b0-8c11-f3ebe64c48a4

flipfloppy1 avatar Sep 30 '23 13:09 flipfloppy1

Did you ever find a fix for this? i'm running into the same issue on the newest version (0.2.6-beta) in 1.20.4

nmills3 avatar Feb 09 '24 12:02 nmills3

Did you ever find a fix for this? i'm running into the same issue on the newest version (0.2.6-beta) in 1.20.4

Nope, the issue still persists for me on the latest version too.

flipfloppy1 avatar Feb 09 '24 23:02 flipfloppy1

AFAIK Bedrock also suffers from this issue, which is called floating point precision error.

Taiyou06 avatar Feb 09 '24 23:02 Taiyou06

I don’t think this is to do with floating-point precision, as it only happens to transparent blocks. Even if that were the case, there should be some way to prevent it as opaque blocks appear totally fine.

flipfloppy1 avatar Feb 09 '24 23:02 flipfloppy1

I don’t think this is to do with floating-point precision, as it only happens to transparent blocks. Even if that were the case, there should be some way to prevent it as opaque blocks appear totally fine.

that's not correct. When i was testing earlier it could and would effect any block. smaller or thinner blocks like buttons, trapdoors and pressure plates would start to have the issue at a smaller distance and if you used a zoom mod from a very long range, like 2000 blocks, you would see any blocks overlap. If you got really far away (5000 blocks) you could even see blocks z-fighting with the blocks under them.

I went and asked in the discord for the mod earlier and basically it apparently boils down to z-fighting and depth precision. While in theory you could have better depth precision, it wouldn't be worth the performance you would lose for it. At least that's what i was told.

Here's an example of the issues i saw. I think this screenshot was from around 1500-2000 blocks away image

As you can see, even the solid blocks start to have issues at this distance

nmills3 avatar Feb 09 '24 23:02 nmills3

I see, thanks for clearing that up then. Would it be possible to have a setting for a higher precision depth buffer then, for people with beefier PCs?

flipfloppy1 avatar Feb 10 '24 00:02 flipfloppy1

you'd have to go and ask the people much smarter than me on the discord server about that

nmills3 avatar Feb 10 '24 00:02 nmills3

This will potentially be fixed by Sodium in the future: https://github.com/CaffeineMC/sodium-fabric/issues/2324

KingRocco21 avatar Feb 10 '24 16:02 KingRocco21

This will potentially be fixed by Sodium in the future: CaffeineMC/sodium-fabric#2324

it wont be https://github.com/CaffeineMC/sodium-fabric/issues/2324#issuecomment-1949272865

Barmem avatar Apr 15 '24 21:04 Barmem

So I’ve investigated this further and it seems like even with enabling glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE), the difference is minimal (ignoring the fact that UI text and block models stop rendering properly). Here's a before-and-after, both taken from the same position without, then with the changes:

image

This could also just be me not messing with it enough to get a better result, but I don’t know for sure whether clip space is the problem. If it's not, it would be good to explore what other potential solutions are out there for this

flipfloppy1 avatar Jul 02 '24 18:07 flipfloppy1