Jump to content
  • Advertisement
Sign in to follow this  
yoshscout

atmospheric scattering (almost working)

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

sun looks great but sky is purpie, my scattering coefficients are the ones given in the preetham paper. i will see if i can post code later. seems like mie scattering is right and rayleigh is a lil off oh and btw one critical thing i rarely see mentioned is that since this is a sky that in perspective never changes position in relation to the viewer (except the sun) is that 'fairly accurate density function' from the papers can easily be precalculated at each vertex in the sky dome and is givin by (in page 2 of preetham siggraph 2003 course notes) 1 ---------------------------------------- (cos(theta) - 0.15*pow(93.885 - theta), -1.253)) where theta is the angle from the zenith(str8 up (0, 1, 0))

Share this post


Link to post
Share on other sites
Advertisement
When I implemented atmospheric scattering I used the Sean O'Neil technique (link) from GPU Gems 2. Check that out it may help you fix your problem.
Quote:

i will see if i can post code later.

That would help.

Share this post


Link to post
Share on other sites
Just to warn you. I didn't find that the Sean O'Niel gave good results when the camera is INSIDE the atmosphere. I would advice you to give the Preetham implementation a go instead. True is it not physical correct, but it gives damn good skies compared.

Share this post


Link to post
Share on other sites
Yeah I found problems with it, but I managed to work around them. The results looked like this.
I abandoned that project along time ago.
/edit
I managed to work around SOME of them. You can see the banding/shearing problems on the top row of images. I think the chapter in GPU Gems 2 says you only get this problem on nVidia not ATI.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!