Star rendering
This section provides a bird’s eye view of the star rendering process implemented in Gaia Sky, with pointers to source files implementing the different aspects of it.
The star rendering process in Gaia Sky consists of two parts. First, we compute a pseudo-size for each star, and then we use all the pseudo-sizes in the star shaders to render the stars.
Pseudo-size determination
We determine the pseudo-size from each star based on the star’s apparent magnitude. First, we get the apparent magnitude as seen from the Sun from whatever star catalog. Then, we correct it using extinction data (if available, see the magnitude/color corrections section).
The Java code that implements this (STILDataProvider
class, used to load external catalogs in CSV or VOTable into Gaia Sky) does not include magnitude/color corrections, the Rust code in the catalog generator program does:
Once we have the corrected apparent magnitude, we convert it to an absolute magnitude with the common formula
where
where
Or in Java, look at method absoluteMagnitudeToPseudoSize(double)
of STILDataProvider
here.
Star shader and rendering
That is only half of the picture though. That gets us the pseudo-size from the apparent magnitude.
On the rendering side, Gaia Sky has the option of rendering stars using billboards (quads implemented as two triangles sharing two vertices) or using native driver points (GL_POINTS
). The code using GL_POINTS
is faster but has some important drawbacks like points being drawn in screen space, which ignores effects like perspective distortion, so we focus here on the billboard quads.
We pass the pseudo-size
Since we are dealing with distant stars most of the time, we can probably get away with using the small-angle formula (i.e. omit
The whole star rendering process involves many parameters (i.e. see the visual settings section) and is quite complex, but with the topics discussed in this section you should have a solid understanding of what is going on behind the scenes.