Jump to content
  • Advertisement
Sign in to follow this  
Quat

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.

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

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
Share on other sites
Quote:
Original post by Quat
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?


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 this post


Link to post
Share on other sites
Quote:
Original post by jcabeleira
This 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.

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!