# atmospheric scattering implementation issue

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

## Recommended Posts

Ignoring emission, the book Physically Based Rendering gives the following formula for the amount of light added to a point due to in-scattering as: S(p,w) = o_s(p,w) * SphericalIntegral( phaseFunc(p,-w'-->w)*L_i(p,w')dw' ) where o_s is the scattering coefficient (probability density of light scattering per unit length), L_i is the incoming radiance at p from direction w'. For implementing this in real-time for atmospheric perspective, where does one obtain L_i(p,w')?? If I just have the sun as the only light source, how am I supposed to come with a function describing the incoming light at any point from any direction?

##### Share on other sites
Hi there,

There are many papers on atmospheric scattering. I suggest check the one in GPU gems series, also the paper from Eric Bruneton.

##### Share on other sites
Quote:
 Original post by QuatIgnoring emission, the book Physically Based Rendering gives the following formula for the amount of light added to a point due to in-scattering as:S(p,w) = o_s(p,w) * SphericalIntegral( phaseFunc(p,-w'-->w)*L_i(p,w')dw' )where o_s is the scattering coefficient (probability density of light scattering per unit length), L_i is the incoming radiance at p from direction w'.For implementing this in real-time for atmospheric perspective, where does one obtain L_i(p,w')?? If I just have the sun as the only light source, how am I supposed to come with a function describing the incoming light at any point from any direction?

Well, for simplicity you can assume that light comes only from the sun and that should be enough to provide you with visually reallistic results.

But for more physically accurate and reallistic results you could take into account the light that comes from all directions. While most of the light comes from the sun direction, a small part of it comes indirectly from the scattering of the sun light on other particles in the atmosphere. This is REALLY expensive to process and thus can't be generated in real-time. If you're targeting real-time atmospheric scattering, it's enough to take into account only the light that comes directly from the sun.

##### Share on other sites
Quote:
 Original post by jcabeleiraThis is REALLY expensive to process and thus can't be generated in real-time.
You can however do this in real-time if you perform a little pre-calculation. Eric Bruneton has a paper and demo on the subject.

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632997
• Total Posts
3009799
• ### Who's Online (See full list)

There are no registered users currently online

×