Print

Photorealistic Earth

Click to enlarge
This 3D Studio MAX 3 scene is a direct adaptation of a great LightWave tutorial written by Dean A. Scott who really deserves all the credits. This document is not intended to be a step by step tutorial but a description of the making of the scene. Even if you are not a 3D Studio MAX user, I hope you'll appreciate the pictures.

The maps used for textures were found at The Living Earth®, Inc.
Before reading further, download scene and textures (4 files, 7 MB in total). Copy everything to a new folder under C:\3DSMAX\SCENES for example.

1. Earth.max
Earth-Spec4096.jpg
Earth-Topo4096.jpg
(earth1.zip)
3D Studio MAX scene
4096x2048 B/W map for masking sea/ground
4096x2048 grey-scale map for Earth bump, i.e. mountains
(all 3 files zipped together)
2. Earth-Cloud2700.jpg Low resolution opacity clouds map
(right click / Save Target As...)
3. Earth-Color4096.jpg 4096x2048 color map for daytime earth surface
(right click / Save Target As...)
4. Earth-Night4096.jpg 4096x2048 color map for night-time earth surface
(right click / Save Target As...)

1. Geometry

Click to enlarge
I created a sphere with the following attributes:

  • Name: Surface / Radius: 12760 / Segments: 98

Then selected Edit > Clone and chose create a copy. I named it "Clouds".
In the Modify tab on the right side of the workspace and under parameters, I entered:

  • Radius: 12780 / Segments: 98

Again, I select Edit > Clone and chose create a copy. Named it "Atmosphere".
In the Modify tab on the right side of the workspace and under parameters, I entered:

  • Radius: 12980 / Segments: 64

And we're done with geometry already!

2. Lighting

I created one target directional light that points to the center of the spheres. I called it "Sun diffuse". Made it white. Under General parameters, unchecked "Specular". This is the Diffuse light.
Then I select Edit > Clone and chose create a copy. Named the new light "Sun Specular". Made it yellow (R250 G227 B226). I made sure Diffuse was unchecked. This is the specular light.
I then clicked on "Exclude..." and added Clouds in the exclude list to avoid that the clouds look like cigarette smoke because they are illuminated by a yellowish light.
Using 2 different lights for diffuse and specular ensure that there is a touch of warm yellow without having the whole scene "dirtied" by this color.
Under Rendering > Environment I made sure ambient light was black (i.e. no ambient light).

3. Earth texture

The texture used to cover the surface of the "Surface" sphere is the most complex and it gives a good example of the power of the material editor of MAX.

The only relevant basic parameter used is glossiness that defines how shiny the globe looks. It is set to a medium value of 40. The specular level is overridden by a specular map.
Let's explore the components of this texture through the Material/Map Navigator.

Under Tools > Material Editor, In the material Editor window, I selected the first material ("Surface") and by clicking on the Material/Map Navigator icon (2 blue balls connected by a dotted line) I get the window on the right here.

The first element in the list is "diffuse color". This channel is used to define what is visible on the areas of the sphere that are in the (sun)light, i.e. the image of seas and continents.
But the real color of water, earth, forests, etc. needs to be altered to take into account the atmospheric effect described here.
We need to add some blue to the image. This is why the diffuse map is made out of a "mix" material with 2 components: the picture of the ground (Earth-Color4096.jpg) and the color blue. Mix Amount specifies 15% of blue added to the picture.

The second element is the specular level that defines how the material reacts the highlight of the spotlight (the Sun) itself. Water is shiny and earth is not shiny at all. Moreover, the closer the specular highlight is to the horizon, the more intense the reflection is.
A mask is used to prevent the continents from displaying a specular highlight (typical behavior of matte materials like earth). Earth-Spec4096.jpg is a black & white image of the surface of Earth. By convention, the white areas (the continents) are masked and the black areas (seas) "show through". Now for the seas, the specularity described above can be represented by a radial gradient with low specularity at the center of the sphere and higher reflection of the Sun on the border. Therefore the specularity map is a gradient material, black at the center and grey on the outside.

The third element will describe the self-illumination of the globe when it is not under direct light, resulting from artificial lighting of the cities or the oil wells in the Persian Gulf. The very powerful Falloff map is used here with the "shadow/light" parameter selected. Falloff generates a map based on the illumination of the scene.
I set it up to do nothing in the lit areas and to display Earth-night4096.jpg in the shadow areas.

Click to enlargeFinally, the last element defines the bumpiness of the surface of the sphere. Once again, sea and land must be considered separately. The bumpiness of sea is defined by waves and the bumpiness of the land is defined by the mountains.
Sea and land are treated separately and then composited to provide the final result.
Sea first. The same mask (Earth-Spec4096.jpg) is used as for the specular effect to avoid creating waves on land. The waves are simply a turbulent noise material of very small wavelength. The result when rendering is very small dots in the specular highlight on the surface of the sea (see picture below).
Now land. The image Earth-Topo4096.jpg provides the necessary elevation information, white for high, black for low. No need for a mask here because seas are all black in the image. In the output panel, bump amount has to be set to 0.5 (instead of 1) to approximate the real height of Earth's mountains and not end up with unrealistic terrain.

4. Clouds texture

A cloud is as shiny as cotton therefore the texture has a very low specularity and glossiness. The shape of the cloud formations is defined by the map Earth-clouds2700.jpg. It is used as an opacity map: clouds are opaque but the surface between them is transparent.

Then a "mix"bump map is used to create the "cottonness" of the cloud formations. A regular noise with a medium wavelength creates the smaller puffs and a turbulent noise with a longer wavelength suggest bigger cloud formations.

Now, when rendering the clouds I spotted a problem: at the border between light and shadow —where the light rays hit the clouds at a very low angle— the bump map generated black spots on the cloud texture itself (ray-traced shadows) that were absolutely not photo-realistic. To tackle the problem I used the falloff texture again to apply bump to clouds proportionately to the level of light. In the transition area between light and shadow the level of bump decreases and does not generate those ugly black spots. I manually adjusted the curve using the output tab of the falloff material to achieve the best possible effect.

5. Atmosphere texture

Click to enlargeNow to create the effect that does most of the work in creating the photo-realistic effect, MAX helps us a lot with a predefined Falloff material that can simulate the Fresnel effect. The Fresnel effect is plugged as a diffuse map. Unfortunately, the Fresnel material options only offer 2 colors for the effect therefore the output characteristics have to be tweeked quite a bit to create the desired complex green-to-blue-to-black gradient.

I hope this helps somehow.