here comes atmospheric scattering
this implementation is based on Sean O'Neil openGL implementation wich has been ported to directx for ogre by HexiDave.
The original converted implementation was vertex shader based for mie and rayleight color calculation and mixed them in pixel shader to try to obtain a smooth result this made sens when Sean O'Neil implemented it on the merly begning graphic hardware but it gave horrible artifact unless you have a over tesselated sphere irrlicht's 256 polygon sphere were just not cutting it.
So i updated the code to make all the calcultations in pixel shader giving a much smoother result independent of the poly count of the sphere.
I just need to verify the license and i will release the completed shader code with constant what is messing and why you most likely are not getting it to work in case you stumbled on my blog by googling HLSL atmospheric scattering