Sign in to follow this  
Quat

Mie Scattering

Recommended Posts

I almost have my atmospheric scattering implementation done, but there is one issue I have not justified. The paper by Nishita (The Display of the Earth Taking into Account Atmospheric Scattering) say for Mie scattering, it is not wavelength dependent. The problem is that they do not elaborate how to modify the extinction coefficients. For Rayleigh, they give the extinction ratio per unit length as: Br = 4*PI*K / L^4, where L is the wave length and float K = 2.0f*Pi*Pi*(n*n-1.0f)*(n*n-1.0f)/(3.0f*N); where float n = 1.0003f; // Air index of refraction float N = 2.504e25f; // Molecular number density So for Mie, you cannot simply just drop the divide by L^4, as then you get an extremely small number for the total Mie scattering. What I ended up doing for Mie scattering, was setting all 3 RGB wave lengths to the wavelength of green (which of course gives white light) so that there is no wavelength variable so to speak. This "worked" in that my results are similar to what others are getting from Mie scattering, but it bothers me that I have not justified this step. Anyone know how to get the Mie scattering coefficient.

Share this post


Link to post
Share on other sites
The Mie is wavelength dependent, that's what it gives it's reddish tone during sunset.

If I'm not mistaken the Mie scattering coefficients can be calculated with this formula: 1.0/(wavelength^2) where whavelength is the whavelength for a given color component (red, green or blue).

Quat, I've been following your posts on this forum, and I think you aren't using the best resources about atmospheric scattering. Nishita is in fact one of the most important resources about this subject, but you should also take a look at some more recent work like the paper called "Real Time Rendering of Atmospheric Scattering for Flight Simulators" or the Preetham paper "A Practical Analytic Model for Daylight". These papers should provide the answers for most of your questions.
I personally recomend you start by reading the "Real Time Rendering of Atmospheric Scattering for Flight Simulators" since it provides an extremelly detailed but light explanation of atmospheric scattering.

There's one more thing: after you get your Mie scattering working properly you might notice that it looks saturated during sunset and shows a strange ring around the sun. I've had this problem for a long time and only today I've worked it out.
The rendered sky needs a tonemapping operator applied to each pixel to make the sky look really good and reallistic. The following operator does the trick:
finalcolor= 1.0- exp(-skyColor*exposure);

where "skyColor" is the pixel color generated through atmospheric scattering and "exposure" is a scalar that controls the overall brightness of the result.

Good luck, and don't forget to post your results when you get them right. ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this