Jump to content
  • Advertisement
Sign in to follow this  

Atmospheric Scattering optical depth (s parameter)

This topic is 2349 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

I am trying to implement the basics of atmospheric scattering. I've read a plethora of sources: The GPU Gems 2 article, the ATI paper, this very detailed paper by Nielsen, this informative Gamedev forum post, 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!