Thursday, June 24, 2010

A Practical (But Simple) Model for Daylight

For the past couple months I've been working off and on, trying to figure out a daylight model for the sky dome. To be more specific, I was attempting to incorporate the model discussed in a paper titled 'A Practical Analytic Model for Daylight'. It's a very interesting read and the theory is useful, even if you don't actually use their approach.

Unfortunately, I wasn't able to get the color conversion to work. Something with the Luminosity value just wasn't coming out correct no matter what I did. So instead, I just took the color gradients I knew I was looking for and hard coded some values to interpolate and presto- a day/night system. It's not bad, considering how simple the color calculations are. The most noticeable problem with this new feature is color banding. At sunrise and sunset, there is not enough of a change in color in the sky gradient, so the colors form very noticeable bands on the sky dome. Even worse, the bands move around as the colors change, which draws attention to the issue. The solution is probably dithering or some other form of noise to break up the pattern.

Eventually I'd like to get a more realistic model working, but for now it's time to leave 'good enough' alone and move on. Below is a series of screenshots taken during sunset.





No comments:

Post a Comment