FlashyReese / sodium-extra-fabric

Features that shouldn't be in Sodium.
GNU Lesser General Public License v3.0
259 stars 65 forks source link

Max fog distance incompatibility with Nvidium mod, causing blacked out terrain #363

Closed Synnef-8826 closed 8 months ago

Synnef-8826 commented 8 months ago

Make sure you are not opening a duplicate.

Minecraft version.

1.20.2

Sodium Extra version.

0.5.2

Sodium version.

0.5.3

What happened?

Nvidium 0.2.0 is a Sodium rendering engine used to greatly increase performance on systems with certain NVIDIA graphics cards.

Pretty much the title. Setting the max fog distance to the maximum (so, disabling fog) causes faraway terrain that'd otherwise be hidden by fog to fade out to all black. Other mods (example) that disable fog don't seem to cause this problem.

Examples:

The vanilla fog in the Nether is thicker by design (and slightly different to the Overworld's), leading to this. Note how entities that technically are within my render distance are rendered properly.

Fresh instance with just Nvidium, Sodium and Sodium Extra (meaning there are no other incompatibilities). Notice the black terrain. 2023-10-14_09 34 37

Same world/instance, but fog distance reverted to default. The terrain that was previously black is now completely hidden by the fog.

Relevant log.

No log is required to observe the issue

Additional information.

My best assumption is that the method Sodium Extra uses to change fog distance does not integrate well with alternative rendering engines, and rather focuses on just Sodium's default rendering. I think it should be changed, seeing how alternative mods can already change fog regardless of rendering engine, and how Sodium Extra is considered the go-to and most popular option for disabling fog on Fabric.

FlashyReese commented 8 months ago

This is technically a bug on Nvidium's end. They are using their own fog fragment shader which doesn't account for the alpha component of the fog color. Cortex contacted me about it, and it should be resolved in their next release.

image

I was previously using a method of setting fog distance for very large distances (this is the method most fog-modifying mods use). However, I stopped using that method because it would drastically affect frame times in 0.5.x if you go above world height. Therefore, JellySquid suggested that I modify the fog alpha instead.

Synnef-8826 commented 8 months ago

Ah, perfect then! I did reach out to Cortex on Nvidium's issue page before ending up here, so it makes sense why he wrote you as well. Unfortunately I don't have the skills to dive into both mods' code and figure out who's problem it was, so I thought I'd ask around on both ends :p

Either way, thanks for replying! I'm glad it's solved now.

MCRcortex commented 8 months ago

You should be able to close this now as i have released 0.2.1 which should fix it

FlashyReese commented 8 months ago

Thank you for resolving this.