clear-skies icon indicating copy to clipboard operation
clear-skies copied to clipboard

[1.16.4] Night Vision at night makes everything black

Open Cooliosity opened this issue 4 years ago • 2 comments

When using this mod and applying night vision while it's night makes everything completely black. The blocks? Black. Mobs? Black. Items in inventory? Black. Text in options screen? Black. It looks exactly like MC-165208

Cooliosity avatar Dec 07 '20 01:12 Cooliosity

The same issue appears in colormatic so you guys could maybe solve the issue together

Cooliosity avatar Dec 07 '20 16:12 Cooliosity

More info:

Basically, Night Vision divides the fog color's RGB values (assuming they're 0 - 1) by the largest value out of R, G, or B; effectively making the fog color as bright as it can be. This works fine for most colors, but if the fog color is exactly (0, 0, 0) then the largest value in the color is 0, resulting in the color being (0 / 0, 0 / 0, 0 / 0). This calculation is why the glitch only happens on some graphics cards, as while some of them (I believe the NVIDIA ones) will set the fog color to (0, 0, 0) others may return a NaN value, resulting in (NaN, NaN, NaN). The NaN values echo through the shaders and rendering code, resulting in a ton of stuff rendering completely black.

grondag avatar Mar 01 '21 15:03 grondag