This topic is 1209 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello everyone

I recently just made a sky and cloud shader, so I have a day night cycle being worked on, it is lacking something though.

I just read through The Order 1886 slides from Siggraph 2015 and they mention an accurate solution to calculating the sun color and intensity based on its location in the sky.

They used the solar radiance function mentioned in the Preetham sky model...

PDF here (starts at page 26):  http://www.cs.utah.edu/~shirley/papers/sunsky/sunsky.pdf

And it all sounds nice but looking at the math it becomes a little confusing.

I am assuming I need to make some assumptions for some of the variables to make it a little easier to code.

The color needs to be set as a Vector3 on the CPU side, and the intensity as a float or double. I am thinking this should be computed occasionally using a compute shader? I have a day night cycle where the sun is moving so I'll need these values every few frames.

But I don't see how to get these values from the function provided, or if that is even the correct function at all. Just hoping someone could point me in the right spot

##### Share on other sites

Is Hosek the best sky model actually ?

##### Share on other sites

This helps immensely! Thanks a lot for the lengthy post, I'll start integrating it into my sky solution. I can't thank you enough, and I love all the work you do

I'm actually surprised that I understand it all. My current sky solution is based on the Preetham model and does not account for ground albedo, I'll see what I can do about integrating that as well. But again, everything you mentioned helps a lot!

1. 1
2. 2
Rutin
19
3. 3
4. 4
khawk
14
5. 5

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633743
• Total Posts
3013643
×