Sign in to follow this  

preetham colors

This topic is 4744 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 implemented the preetham paper for the sky successfully, more or less, as soon as the sun gets hided by the horizon the sky gets an ugly yellow color, and it's not black, plz hlp [depressed]

Share this post


Link to post
Share on other sites
I assume you mean the paper

http://www.cs.utah.edu/~preetham/papers/p91-preetham.pdf?

Difficult to reply to an implementation question without some implementation information.

Do not the figures 7 and 8 show the sky turning yellowish at sunset?

Share this post


Link to post
Share on other sites
I had some luck implementing that algorithm in my previous engine (will soon make the same shader in the new engine since I kept my old code), and initially had the same problem although it may have been caused by a math error that I corrected later. One thing that may be causing this are the RGB values by wavelength used in the actual paper are innaccurate. Use the standard RGB used with computer monitors. Yann posted these numbers in a post on the Graphics Programming and Theory forum to correct discoloration problems with this algorithm. Another solution if this doesn't fix it is to simply interpolate the sky's alpha values to 0 at night.

Share this post


Link to post
Share on other sites

This topic is 4744 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.

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