Sign in to follow this  
GraphicsBas

O'Neil Atmospheric scattering scale function

Recommended Posts

Hey all,

I have implemented O'Neils atmospheric scattering from space as described in GPU Gems 2. I have got it working the way I want except that I having trouble making the atmosphere larger/bigger. O'Neils implementation uses a predefined scale function which limits the atmosphere to be 2.5% larger than the planet itself. Currently this is what I have:

[img]http://bassie-entertainment.com/wp-content/uploads/2011/05/sick2.png[/img]

What I want to achieve is a larger atmosphere, as seen in Spore for instance:

[img]http://www.freewebs.com/danielsblog/Spore%20Planet.jpg[/img]

It is obvious that in the screenshot above the atmosphere is much larger than 2.5% of the planet..

So my question is: how to adapt O'Neil atmospheric scattering approach to account for a larger atmosphere.

Share this post


Link to post
Share on other sites
Somewhere in your shaders , you should adapt the exponentials : exp(-h/H) h = your altitude , H = the height where the considered quantity is the highest concentrated for example there are two values : one for mie scattering and one for rayleigh scattering.

If you simply integrate the shaders as they are provided in Gpu Gems2 in your renderer , try to find the constants that are used in the denominator of the previous exponentials...
You can put what you want in it if you stay in the same coordinate range in the full pipeline of calculation.

Oh and just to comment the pic of spore, there is no atm scattering in there...

Share this post


Link to post
Share on other sites
[quote name='boubi' timestamp='1305669717' post='4812119']
Oh and just to comment the pic of spore, there is no atm scattering in there...

[/quote]

Thats very interesting, what I want to achieve is more of a 'spore-like' planet than a correct solution. Can you maybe provide me with more information on how the sky in spore is rendered?


Share this post


Link to post
Share on other sites
[quote name='Bas Zalmstra' timestamp='1305670012' post='4812121']
[quote name='boubi' timestamp='1305669717' post='4812119']
Oh and just to comment the pic of spore, there is no atm scattering in there...

[/quote]

Thats very interesting, what I want to achieve is more of a 'spore-like' planet than a correct solution. Can you maybe provide me with more information on how the sky in spore is rendered?



[/quote]


From what i see i guess they render a second sphere with alpha blending , and modulate alpha by dot(N,L) L being sundir and N sphere normal...

Share this post


Link to post
Share on other sites
You might find this interesting:

[url="http://petrocket.blogspot.com/2010/01/simple-flexibile-atmosphere-shaders.html"]http://petrocket.blogspot.com/2010/01/simple-flexibile-atmosphere-shaders.html[/url]

There's also some newer posting on the same blog that you might find useful.

Share this post


Link to post
Share on other sites
[quote name='PolyVox' timestamp='1305674625' post='4812154']
You might find this interesting:

[url="http://petrocket.blogspot.com/2010/01/simple-flexibile-atmosphere-shaders.html"]http://petrocket.blo...re-shaders.html[/url]

There's also some newer posting on the same blog that you might find useful.
[/quote]
Thanks that is very useful indeed! :)

For other people reading this:

[url="http://petrocket.blogspot.com/2010/04/atmosphere-shader-update-and-treegrass.html"]http://petrocket.blo...-treegrass.html[/url]

Thats the link with the improved sky shader.

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