Texturing a Sphere in Blender to Make a Moon Animation

, in Computing, Video

Blender animation showing the final result - an orbit of the moon

Let me be upfront about this - I am in no position to give a tutorial on Blender. In fact, I have only been using Blender for a couple of weeks so take everything I say here with a large grain of salt.

So what I am doing here? Firstly, I am showing off how l33t I am with the above animation that took me hours to complete. But secondly, I found that there are plenty of excellent video tutorials for using blender online but very few text based resources so I am putting this out there in case someone else needs this but does not want to wade through hours of YouTube.

I probably did a bunch of things wrong so don't follow this too closely.

First Steps

To make an animation like this you need 2 images - a texture and a displacement map. The texture controls the colour of the surface at each point. The displacement map controls how high the point is above the surface.

For the Moon this is easy, NASA provides both for exactly this purpose as part of the CGI Moon Kit.

Moon textures, part of the CGI Moon Kit from NASA's Scientific Visualization Studio
Moon textures, part of the CGI Moon Kit from NASA's Scientific Visualization Studio

Displacement maps are a really cool way of providing detail without actually modeling anything but they only work in the Cycles render engine and only if you turn on the Experimental feature set in the Render Properties tab.

This is how you want the settings to look like
This is how you want the settings to look like

The model is laughably simple - it is a UV Sphere but I think I probably should have used an Ico Sphere instead. UV Spheres are easier to unwrap for manual texturing but we are not going to be doing that and Ico Spheres are much nicer around the poles. I don't think it matters too much here because of what we are going to do next.

We are going to deform the sphere to add real mountains and craters to the surface using the displacement map but our sphere does not have very much detail to work with. To fix this, go to the Modifier tab and add a Subdivision Surface modifier then turn on Adaptive SubdivisionIf you don't see a control for Adaptive Subdivision then you have forgotten to turn on the Experimental feature set in the Render Properties.. This automatically adds geometery around the bumpy areas of our displacement map.

The subivision surface modifier
The subivision surface modifier

Now we need a material.

Setting up the Material

The material - the nodes are described below
The material - the nodes are described below

This looks daunting but I love the way materials are created in Blender. The nodes clip together is such a satisfying way.

From left to right we have:

I didn't bother with bump mapping since we have real displacement.

Now all that is left to do is set up some dynamic space lighting and animate a flyby.

Problems

I am not totally happy with the animation above. These are the problems I can see: