Found a handy little technique to add fog in post processing. Because.. well in TS workspace renders, you don't have fog. So I learnt how to make fog using a Map Value node and a Mix node with an add algorithm. You can download the file here. (You may have to register first)
So the idea is to use Z depth information into a Map value, then using the following idea play with an Add formula and the original you want to add fog to to get a final result.
2 compositing nodes to add some distance fog in Cycles. I unburried the idea from a tutorial by (the famous) Andrew Price. Give attribution to him, if any. I just made a quick scene to show the effect in action.
In the "Map Value" node: -- Offset: Distance of the fog relative to the camera. (Negative values are in front.) -- Size: Acts a bit like a density setting. -- Minimum: Just keep it at zero. -- Maximum: Limits the effect. (Especially useful for the sky.)
In the "Add" (Color Mix) node: -- Fac: Map Value. Don't touch. It does all the trick. -- Image (top): Source image. -- Image (bottom): Fog color. You're not limited to shades of grey.
Unfortunately, it's not practical to make a node group of this because most of the needed values can't be exposed. Anyway... Enjoy!
Thanks to Kaluura and Andrew Price, though I know them not.