Jump to content
  • Advertisement
Sign in to follow this  

Simple Solar Radiance Calculation

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

Hello everyone smile.png  


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.


Slides here (slide 71): http://blog.selfshadow.com/publications/s2015-shading-course/rad/s2015_pbs_rad_slides.pdf


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. blink.png


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


Thanks for your time guys



Share this post

Link to post
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 wink.png


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!



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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!