Add better way to change sun direction

Currently the only way to adjust the direction of the sun is with Lighting.ClockTime and Lighting.GeographicLatitude. For example, I cannot properly position the sun when the player is on the underside of a planet. The sun just fades and disappears into nothing and turns the entire game dark at night when moved using Lighting.ClockTime

A possible API solution could be to add Lighting.SunDirection, which would take a unit vector and make it so all sun shadows come from that direction.

40 Likes

This would be extremely useful not only for space games, but games with lower than expected horizons (in fact, the sun seems to disappear about 5 degrees above a perfectly level horizon, which doesn’t really fit anywhere).

I’d like to extend this, though: It would be great to also have this for the moon, and to additionally have an API to create new skybox objects that can use this. Use cases include fixed star constellations, additional moons, other planets and so on and so forth.

11 Likes