atmospheric scattering implementation issue

Started by
2 comments, last by swiftcoder 14 years, 1 month ago
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?
-----Quat
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.
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.

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.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement