Stellar View

Stellar View

1M Downloads

Star Luminosity and Shadows

Noobly-Walker opened this issue · 0 comments

commented

This is an issue I've long stewed over mentally. It started with #22, where I suggested how planetary phases might work. Later, I learned comets would function in the same manner, making such things prerequisite for both. The confounding issue then became, well, what happens in multi-star systems?

This suggestion is a bit more involved, and could potentially be the centerpiece of a whole update.

Luminosity

Space objects would have luminosity. If not explicitly defined, this value defaults to 0, but it can be set to arbitrary values. This may have an impact on blending, with brighter objects fading into the sky less than dimmer objects at the same distance. i.e. should someone turn Jupiter into a star a la 2001: A Space Odyssey, it might be visible even during the day.

Luminosity of objects is important for many reasons. Firstly, all objects in a system would somehow receive a list of all luminous objects (that is, objects with luminosity >0) in that system (minus themselves). The distance between each object and a luminous object, combined with the luminosity of that luminous object, would result in a relative brightness. The object that has the most relative brightness is the primary light source for any given object. Comets would have their tails point away from that object (and the relative brightness may be used to tell comets whether their tails should appear or not, and to what extent), and non-luminous objects (or very weakly luminous objects) would be phased in relation to their light source.

If there are no light sources in a system, the view center defaults as the light source, regardless of whether or not it is luminous.

Shadows, Phases, and Comet Tails

Phases would be dictated by the angle between an object, its light source, and the view center, as told in #22. Objects may have a function that may return the angle, perhaps as a quaternion or something (that's what quaternions are for, right?). The output of such would be used by non-luminous bodies to determine phase, and by comets to determine which direction their tails should point.

As mentioned in #11, phases could be added as a separate layer on top of object textures, and as I pontificated about back in January, phases could even be made angled, allowing for more options when it comes to lighting combined with axis rotation.

Image

Implementation of eclipses could also make use of this, though it isn't enough information to carry that out yet, as the apparent sizes of the view center, light source, and body would have to be taken into account for such. A simple implementation would be, if the light source, object, and view center are really close to 0° or 180°, an eclipse should occur.

Non-solar use cases

As stated above, every object is given a list of every luminous object, and math is done to figure out which of them is relatively the brightest. It wouldn't be hard to conceive of a system where a body's primary light source changes over time. A circumbinary planet might alternate which star serves as its light source, while an object orbiting an M-class star which is in turn orbiting an O-class set to go supernova would have its primary light source switch to the M-class star once the O-class has died completely. The swapping of light sources would be quite noticeable, though stacking multiple phase layers with varying transparencies (one for each luminous object depending on brightness) might ease that a bit if this is an issue.

Black holes may still be given luminosity values, simply due to often having brightly glowing accretion disks. This would make phases possible even in systems like Cavum Tenebrae.