hmm.. you dont need to use this mehtod with a single pass shader. Simply calculate the normal fog values in that shader...to do this simpoly find this block of code in the vertex shader:
// float ofog = 1 - (distance(PosWorld, vecViewPos) - vecFog.x)*(vecFog.z);
// Out.Fog = ofog;
Out.Fog = 10000;
and just uncomment the first two lines, and comment out this one:
Out.Fog = 10000;
then you should have correct fogging.
About how i learned about shaders: just a lot of work converting other shaders, reading theory, and asking questions. I am by no means an expert, however.