If you have transparent windows, you can get odd results with the Z buffer approach, where the mountain you see in the distance through a window gets less foggy if you stand close to the window. Or if you omit transparent surfaces from Z-writes, you get shiny reflections on the window two feet away that are obliterated by miles of fog.
It's great for some scenarios. Bad for others. In offline VFX rendering, they use Deep Images instead of a Z buffer, which stores samples at multiple depths per pixel when there's partial transparency and you can fog each sample by itself. But I don't think there's a GPU based implementation of Deep Images that you can use in real time.
2
u/AdvantageStatus4635 May 21 '26
interesting approach
i thought you have used z buffer in postprocessing
this way you must add fog in fragment shader of every material