I need to create a scene with fog, i.e. distant elements faded out towards gray. I can't afford volumetric fog, because the renders would be way too slow. I'd like to just use a simple camera-to-object distance shader to interp the color toward mid-gray. I know that's not physically accurate but I think it'll be good enough for my needs.
I've seen how to do it with a depth pass and use that in the compositor, but I'm wondering if it can be done with a "global shader" right in the renderer? I'm using Cycles in Blender 2.93, recent nightly.