# Mie Scattering

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

## 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 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. ;)

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
14
5. 5

• 14
• 10
• 23
• 9
• 47
• ### Forum Statistics

• Total Topics
632636
• Total Posts
3007574
• ### Who's Online (See full list)

There are no registered users currently online

×