Question about Atmospheric Scattering by Nielsen

Started by
3 comments, last by LJaeha 14 years, 8 months ago
hi, I hope this is the right place to ask. (this is my first visit ^^;) I read this paper named "Real Time Rendering of Atmospheric Scattering Effects for Flight Simulators" by Nielsen. Anyone famliar with this topic should've seen this formula below.(I hope..) L = (Br(th)+Bm(th))/(Br+Bm) * Esun * ( 1-exp(-(Br*Sr + Bm*Sm))); (where, Br(th), Bm(th) : Rayleigh and Mie Scattering Br, Bm : Total Rayleigh and Mie Scattering coefficient Sr, Sm : Optical depth of both Rayleigh and Mie Esun : Intensity of the sunlight) //by the way, how can I insert image here? So far, I found out that I can get this "L" value with a couple parameters such as wavelengths of visible light, angles between sun and viewing ray, etc. But I don't understand how to process this "L" value after I finished this computation. I shouldn't put it directly into RGB values and return it, right? so.. what's next? Is this something to deal with color conversion? then how..? Can you give me some specific example or explanation? Thanks!
Advertisement
The "real" formula is valid for a specific wavelength. So to get an RGB color you can use in rendering, you need to evaluate it 3 times, for the red, green and blue wavelengths. But most people implement the equations using vector maths, so evaluating at three different wavelengths is equivalent to multiplying the rayleigh and mie coefficients by some vec3 constants. I don't remember the exact calculations from the top of my head but it's probably described somewhere in Nielsen's paper too.

The single biggest problem in implementing atmospheric scattering IMO is finding the good range for parameters and constants. They're very application dependent. If you get some of them wrong you'll end up with an all-black or all-white atmosphere.

Y.
Thanks for your reply, but my question remains unsolved.

To make problem simple and specific, I'll consider only Rayleigh, not Mie.
This might be possible situation,
so..the above equation can be written like this,

L = (Br(th) / Br) * Esun * ( 1- exp( - Br * Sr));

//And.. I'll need to do some math here.

Br(th) = (pi^2 * (n^2-1)^2) / (2*N*lambda^4) * (1+cos(th)^2)
Br = (8*pi^3*(n^2-1)^2) / (3*N*lambda^4)

Br(th)/Br = (3/(16pi))*(1+(cos(th))^2) = 0.12 approximately.(when th = 1)
Esun = RGB color of the sun like it's said in the paper
1-exp(-Br*Sr) = some value between 0 and 1 since Br*Sr is greater than 0

so whatever the wavelength is, you can assume it is 650nm for red,
"L" value comes out to be very small to be a COLOR value since its range is 0~1.

Now,
You mean I have to find "some" constant to scale L value to put it into RGB?
To me it's unreasonable..
it would be better, if I miss something..

Thanks


That looks correct to me. Remember that the calculation is done in HDR, you'd have to tone-map the colors before displaying them. If in your scene a wall is white, say 1.0, the sun's color should be a lot brighter than it, for example 10.0. The colors/values/parameters shouldn't be clamped until at the very end.

Y.
I see. Thanks !! ^^

This topic is closed to new replies.

Advertisement