this is a very fast & efficient implementation of the Preetham Sky Model into the BGE.
Through the use of the material nodes, this shader will work both in-game and in your viewport.
To use it, just link/append the “Skybox” object into your own .blend file and select your sun object in the “Lamp Data” node. The rotation of the selected sun will then be used for the sky’s sun.
The shader uses two pre-baked data images similar to the approach from [ http://csc.lsu.edu/~kooima/misc/cs594/final/part2.html ], but with a much more accurate baseline data. This saves the computational cost of a complete Preetham calculation by only losing a small bit of accuracy.
BGE_Skybox.blend (852 KB)