Jump to content
  • Advertisement
Sign in to follow this  

Atmospheric Scattering K constant

This topic is 3158 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In Nishita's paper, "Display of the Earth Taking into Account Atmospheric Scattering", they define a constant K = 2*Pi^2 * (n^2 - 1)^2 / (3N) where n = 1.0003 is the index of refraction of air and N is the molecular number density of the standard atmosphere. If using meters, N is around 2.504e25f; If you actually compute K out you get 9.31 X 10^(-32). I could not get this to work in my pixel shader (I'm thinking it is a precision issue, and values were showing up as 0 in PIX that I know were not 0). Anyway, Sean O'Neil uses: K = 0.0025f; but he does not derive it, although he bases his approach on Nishita, too. So does anyone know how he gets that? Also he defines: m_fWavelength[0] = 0.650f; // 650 nm for red m_fWavelength[1] = 0.570f; // 570 nm for green m_fWavelength[2] = 0.475f; // 475 nm for blue So it looks like he is using micrometers? Does that mean everything needs to be converted to micrometers for this to work (distances used for extinction and etc. ?)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!