I have adjusted code to incorporate fog with this shader. pm if interested