Translucency hides fog pass (old issue inherited from chocapic)
MangoDev1 opened this issue ยท 2 comments
This is an old issue that was in base Chocapic as well, so it's just inherited in this pack. Below I took some screenshots in an empty superflat world set to the biome minecraft:sparse_jungle
for heavy fog. This seems to only happen with blocks with translucency (glass, stained glass, water, etc.) as opposed to transparency (ladders, vines, leaves, chains, lanterns, etc.). I have also noted modded blocks with translucency also run into this issue.
Glass, stained glass, & tinted glass (left to right):
View of sky when looking through the inside of a water body (heavy green fog should be visible, but isn't):
I'm using Minecraft 1.20, Fabric, and Sodium+Iris, but I know that this issue happened with base Chocapic and Optifine as well.
This is not a bug, but a limitation of the depth buffers.
the depth buffer cannot show translucency, because if it did, stuff seen through it would be read to be MUCH closer than they actually are in the depth, so it has 2 modes: treat them as opaque, or ignore their existence.
i have it set to treat them as opaque, so from the fogs perspective, you cannot see through glass, so it cant draw to pixels you cannot see.
the only way i can fix this is to render the fog twice, once behind the translucents, and then once after the translucents are added onto the scene. however... rendering fog twice is slow...
there are many ways to handle this problem in shaders, but my options are limited to how the shader is set up and the performance budget i have set for myself.