I have been playing a bit with the sky shader that martinsh released with the RPGv01 file.
The prototype for preethams sky implementation has ben discussed before, but then the shader was using "gl_LightSource.position" as sun, while in this newer code, the shader looks for the object "Sun" and uses its rotation for defining the sun. The only thing lacking is the nightsky (which would be a texture I guess, that rotates accorind to the rotation of the "sun" object).
Anyhow, beside from the lack of nightsky, the color of sky is really realistic, but I was lacking the look that the sky is more blue during the day, and more red at dusk and dawn. To achieve this effect I changed the code so that the strenght of the reileigh is stronger during dusk, and weaker at noon, depending on the sun vector. The fix looks like this: the last line in the code:
In the original code, if you wanted the dusk more red, the day would be more white, with this fix it will be the opposite, the more red, the more blue!
The full shader is available here!
Preetham Sky 2k.jpg