pioneerspacesim/pioneer — pull request #1319 by Ae-2222 (2012-06-28 20:31:46+00:00)
Title: Adjust star fading and add star twinkling

Changes star field fading to involve more factors.
* Covers the following cases:
* Fade star field as you gain altitude
* (Avoids pop-in when leaving planet frame.)
* Takes the brightness of suns into account (based on temperature and sun radius)
* Stars are visible on planets far away planets/in systems with dim stars
* Starfield finishes fading into view only once the sunset is finished
* Systems with no light sources which use the default light source will have stars visible

Adds starfield twinkling which is applied once in the lower portions of an atmosphere (when atmospheres get cooler with little turbulence the effect is reduced)

Code Observations:
I followed Luomu's structure but moved uniform calculations into starfield and passed data to and from Camera. Materials are per space not per camera, so setting intensity should ideally be done in starfield::draw, like in my branch, for the other uniforms (perhaps by storing uniforms in an extended background material in camera).