NishitaAtmos.osl is an osl shader for rendering a sky based on Nishita's paper in 1993 entitled "Display of the Earth Taking into account Atmospheric Scattering". It's mostly written based on the following article: http://www.scratchapixel.com/lessons/3d-advanced-lessons/simulating-the-colors-of-the-sky/atmospheric-scattering/
For some example renders, see: http://bensimonds.com/2014/10/02/atmospheric-rendering-with-osl/
- Import text into blender.
- Enable Open Shading Language from render options.
- Use as OSL shader from script node.
Sun still lights sky when below horizon. Need to track down why this is and fix it. Fixed!