Every scene in Drift is lit by the Sun: it makes the day side of Earth bright and puts a lit face on your ship and on the passing asteroids. But there was nothing in the sky to look at. This pass adds the Sun itself.
One light, one Sun
The sunlight in each scene is a single directional light, and the Sun is now placed to match it. A small piece of the game sits very far out, along the direction the light comes from, and follows that direction every frame. Wherever the light shines from, the Sun is there, so what you see in the sky and what lights your ship can never disagree.
The Sun is drawn at roughly its real size in the sky, about half a degree across. From Mars it's smaller, about a third of a degree, as it really is that much farther away.
Getting the look right
The first version was just a bright disc, which looked like a star. The solar system pack I use for the planets ships a Sun glow, so I tried that next. Seen from this far away it turned into a ring with a dark gap, like a total solar eclipse, because it was built for a planet-sized close-up.
So the glow is my own: a soft sphere that is brightest at its centre and fades smoothly toward its edge, laid over a small white-hot disc. The colour is a warm white. From space the Sun is white, not the orange of a sunset.
One more fix came from flying it. I'd placed the Sun two billion units away, and at that distance it wasn't drawn at all. At 200 million units, still far beyond the Moon, it draws correctly.
Where it shows
The Sun is now in the Earth scene, the Mars scene and the hangar. In the hangar, the default view looks at the shuttle and doesn't face the Sun, so it only comes into view when you look around with the right mouse button.
Behind the scenes: a memory warning
Since the asteroids went in, the editor showed a red warning about ray-tracing memory. The cause was a surprise: each rock pointed to a much larger "cluster" mesh as its collision shape, and the game loaded all eight of those along with the rocks. The flybys don't use collision, so those links are gone, and ray tracing is switched off on the rocks themselves. The warning has gone, and the game no longer loads those eight meshes.
What is still rough
- I've only seen the Sun with the sunlight temporarily aimed ahead of the ship, because the Earth route spends a lot of its time in Earth's shadow. I haven't yet watched it appear in real daylight.
- It's a glowing ball. A bit of lens glare, or light bleeding over the ship's hull when the Sun is close to the view, would sell the brightness better.
- On Mars the Sun is meant to be smaller, but the glow around it dominates, so it looks about the same size as at Earth.
What's next
The first steps toward the rest of the solar system: a map with the planets on their orbits and the two asteroid belts, or a first belt destination to fly to.
Disclaimer
This is a work-in-progress development log. Everything shown is a prototype and is subject to change without notice. All images in this post are in-engine screenshots.
Back to Blog Drift