Sign in to follow this  

Atmospheric Scattering optical depth (s parameter)

Recommended Posts

I am trying to implement the basics of atmospheric scattering. I've read a plethora of sources: The [url=""]GPU Gems 2[/url] article, the [url=""]ATI paper[/url], this very detailed [url=""]paper by Nielsen[/url], this [url=""]informative Gamedev forum post[/url], and a slew of other Google results on the topic.

I have my sky dome, I have my terrain, I have my shaders all set up. The one thing that eludes me, after reading all this stuff, is the scale I'm supposed to be working with. As I'm doing all this from ground level within the atmosphere, I'm using the 's' parameter simply as the depth from the vertex to the camera.

What is the range of this value supposed to be? All the other parameters (rayleigh and mie consants, 'g' parameter, etc.) are set up as constant values, which would imply that 's' has to be in a specific range for the atmospheric scattering effect to be correct.

I seem to have gleened that I want a difference of radii of 1:1.025, ie if the planet radius is 10.0 then the radius of the atmosphere should be 10.25. But is 10 and 10.25 the actual numbers I'm supposed to use? When I stand on the planet's surface and look straight up, should my 's' parameter be 0.25? Because I'm getting either a black sky or an enormous sun, but I can't find the right range that will give me the realistic sky I want.

For reference, I'm using numbers like betaR = vec3(0.00000695, 0.0000118, 0.0000244), betaM = vec3(0.00000125, 0.00000125, 0.00000125), and g = -0.93.

What range should my 's' parameter be in? Edited by Funkymunky

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this