That sounds possible with a fragment shader, though you will need to turn off the default fog and compute the custom fog yourself then.
A simple way (but not the best) is to get the depth of the pixel being rendered and shade it more or less depending on its value.
Without shaders? I don't see an option for that. What are your trying to do? Are these nodes actually in the game world?