dunno, maybe i'm just misunderstanding you, but from how i understand you are talking about a fog which has more density for example on the right side? if thats what you are talking about than you would need to calculate that fog for every object.
if you just replace y by x in the shader you will not have the nice transition between the sky and the rest of the world