Post news RSS Glassy Red Moon

It is time to remove the placeholder sky with a sky that fits Aero Empire's world, starting with the moon.

Posted by on

Aero Empire's world is not Earth. The planet size is different, the atmosphere is different, including the immense twilisphere which extends across the entire planet. And so, the celestial surroundings of the planet should also be different. To be honest, we were never planning on making the moon plain and gray like Earth's moon - that was just a placeholder made by me.

And so, as we get closer to releasing our demo, we want to make sure the atmosphere of the game fits well - and that includes changing the moon, stars, and we are even planning on adding rings to the planet.

The new moon, rendered in game.

We decided not to add two moons, as that has been done a lot to achieve the "otherworldly" effect, and since moons interact with the lighting and atmospheric scattering, adding too many would be computationally expensive. So we decided to add one moon - but to make it a glassy and reflective moon with a reddish color. This should instantly give the impression that Aero Empire is not Earth, and should also be interesting to look at.

The moon was created by three image maps (it is not a sphere, as we are not going to have the moon rotate). Those three maps are as follows:

The diffuse color of the moon.
The moon is a primarily red color, with large continents that are darker and smoother and with cracks exposing lighter and warmer areas of the moon underneath.

The bump map and specular map of the moon.
The bump map defines the radius of the sphere of the moon at each pixel, where lighter colors have larger radii, and darker areas have smaller radii. This also doubles as the specular map, as the highlights are stronger on the continents, so it needs a lighter color there, and the weaker on the cracks so it needs a darker color there.

Instead of using an ordinary bump map for the moon which is suited for flat surfaces, I decided to use a spherical bump map, which fits the spherical shape of the moon better. This works by computing the position on the sphere for each pixel, and then multiplying that by a radius defined by the the bumpmap (where darker colors are smaller radii, and lighter colors are larger radii). The 8 neighboring pixels are then used to compute 8 triangles connecting to the center pixel (as if this was a real spherical mesh with vertices defined per pixel). The normals of these triangles are then averaged to get the final normal for the center pixel. This makes a normal map where the bump map extrudes from a sphere as opposed to extruding from a plane (which is what normal bumpmapping essentially does).

The normal map for the moon generated by spherical bumpmapping.

Then, by tweaking the lighting parameters for the moon inside the engine, and applying a specular map to the moon's lighting, I achieved the final in game effect. The highlight is an especially nice touch - it is interesting to observe, and the rarity of shiny moons make it instantly give off an otherworldly appearance (as does the deep red color the moon reflects onto the scene).

A collection of images with the sun and moon at different positions.

Look forward to more updates as we crunch towards the demo release date, including planetary rings, a gyro test flight video, and the finished HUD!

- David


Very nice texture. Abit detailed compared to the world though...

Reply Good karma Bad karma+2 votes
terra0nova Author

Yes, the moon is a little too realistic for a non-realistic game. We've been thinking of some tweaks to make it fit the world better - one of which was to tone down the shading of the cracks, which were way too large anyways. The gyro controls are done now, I'm just waiting for a fix for the gyro animations before I post a video, and when I do, I will also take some shots of the improvements to the moon.

Reply Good karma+1 vote

Love it.

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.