In this tutorial, Sri Lankan 3D artist Buwaneka Saranga shows you how to create a photorealistic Earth using a mix of Maya and Photoshop.
He’ll teach you how Maya’s Sampler Info, Surface Luminance, Remap HSV and other powerful shading nodes work together when creating a realistic planet, which you can use to produce a rendering of our home planet as he does, or to create authentic-looking alien worlds. He’ll then show you how to add polish to the render using Photoshop.
For the tutorial, we’re assuming that you have a good grasp of the basics of Maya, as Buwaneka won’t be detailing basic concepts such as nodes, the Outliner or Hypershade windows, or creating primitive geometry.
Before starting, you’ll need to download a series of textures from NASA and rename them. You’ll need Earth (Land), City Lights, Clouds, Bathymetry (which is used as a specular map), and Topography (used is as a bump map).
You’ll be using textures with a resolution of 8,192 x 4,096 pixels. Buwaneka suggests downloading the highest resolution textures and reducing them to 8k in Photoshop. Even so, using these high-resolution textures will require a hefty amount of RAM and CPU power, so we’re assuming you have a powerful system.
Time to complete
Maya 8 or later, Photoshop 7 or later
Open Maya, create a new project and name it ‘Photorealistic Earth’. Hit Accept, then copy all the textures you’ve downloaded into the source images subfolder.
Create a polygonal sphere with a radius of 20 units, and axis and height subdivisions of 64. Name it ‘earthGeo’ in the Channel Box, and duplicate the sphere four times by hitting Cmd/Ctrl + D. This is to make the different layers that constitute the earth. Open up the Outliner window and rename the four extra spheres as shown: ‘citylightsGeo’, ‘cloudsGeo’, ‘atmosphereGeo’ and ‘atmosphere1Geo’.
Hit 5 to see a shaded mode in the viewport. Now let’s shine in some light. Create a Directional Light and give it a slight angle (-8 degrees in the X axis). Don’t bother to move the light from the origin, as this won’t have any effect since the directional light resembles a huge array of light coming from infinity. Increase its scale, so you can see it in your viewport.
Let’s create some render layers to put our geometry in. It’s important to render this separately as a pass to ensure greater control over the output. Go to the Outliner window and Shift + select the first sphere, earthGeo, in combination with directionalLight1. Click the button to create a render layer, double-click it and rename it: earthRender.
Repeat this for the other spheres to create ‘citylightsRender’, ‘cloudsRender’, ‘atmosphereRender’ and ‘atmosphere1Render’.
Select ‘earthGeo’, and assign an Anisotropic Material to it. Under Specular shading, set the Angle to 0, Spread X to 9.846, Spread Y to 4.973, Roughness to 0.847 and Fresnel Index to 6.653. Assign a file texture to the Color channel and plug in our Land texture from the project files to it, ensuring the filtering is off. Turn on hardware texturing from the Viewport menu bar to see the texture on our sphere.
Rename the material from ‘anisotropic1’ to ‘earthShader’. Next, assign bump and specular textures to our ‘earthShader’. Assign a file texture to the bump channel and select our bump texture, and set it’s bump depth to 0.010. Next, assign a file texture to the Specular Color channel and select our specular texture.
If you create a preview render right now, you’ll see the specularity in action, but our bump detail has been lost. We’ll quickly adjust this by using a remapHSV node in the next step.
Open up the Hypershade window, and pull out a remapHSV node. Hold Shift + the middle mouse button, and drag the specular file texture node onto the remapHSV and connect the file texture’s outColor to the Color channel of the remapHSV node via the Connection Editor. Connect the remapHsv node to the Specular Color of our ‘earthShader’ under its Specular Shading attributes.
Open up remapHsv’s attributes, and create a curve like that shown on its Value graph (above). Create a preview render and your bump detail will be apparent.
It’s now time to create our city lights. Select the ‘citylightsRender’ layer. Assign a Lambert material to ‘citylightsGeo’, and name it ‘citylightsShader’. Reduce the material’s colour down to black (0) under its attributes, and plug in the city lights texture to the Incandescence channel of the material attributes.
The city lights texture should only appear where it isn’t illuminated with light. To do this, go to the Hypershade window, and pull in a surf.luminance node, and a reverse node. Hold Shift + the middle mouse button, and drag the surf.luminance node on to the reverse node, and connect it’s out value to the input X, Y, and Z.
Now hold down your middle mouse button and drag and connect the reverse node to the Color Gain of the city lights file texture, under Color Balance attributes.
Hit a test render, and you’ll notice that the light fall off on the city lights is way too high. Let’s reduce it. Make sure, you’re on ‘citylightsRender’ layer, and select the directionalLight. Go to its attributes and increase the intensity to 10. Right-click on it and select Create Layer Override.
This increases the light’s intensity only for the currently selected layer. Ensure the intensity stays default in other layers.
Jump into the ‘cloudsRender’ layer, and assign another Lambert material to ‘cloudsGeo’ and call it ‘cloudsShader’. Plug in a File Texture node to its Color channel and load the clouds texture on it. Click on its Ambient Color swatch and set a colour of H: 206, S: 0.320, and V: 0.112. Hit Render to see a preview.
Now for the most important part: the atmosphere shader. Select the ‘atmosphereRender’ layer, select ‘atmosphereGeo’ and assign it an Anisotropic material. Rename it ‘atmosphereShader’. Under attributes, give it a solid colour of H: 195, S: 0.7, V: 0.7. Also under Specular shading, set the Angle to 12.308, Spread X to 3.515, Spread Y to 2.662, Roughness to 0.509, Fresnel Index to 20, and Specular Color to H: 194, S: 0.350 and V: 0.250.
Connect the ramp node to the Transparency channel of our atmosphereShader. In the hypershade, hold Shift + the middle mouse button, and drag the samplerInfo node onto the ramp node. In the connection editor that pops up, connect the samplerInfo’s facing ratio attribute to the vCoord of the ramp.
Right now if you hit render, you’ll notice that the atmosphere shader shows up even in the dark side of the earth. Which we’ll fix by connecting our surf.luminance node to the Color Gain of our ramp node.
Now, all that’s left is to create the second atmospheric shader, create a blinn material, and similarly attach a ramp followed with a samplerInfo node. Open up the blinn material attributes and give it a colour of value – 0.809
Under Specular shading, set the Eccentricity to 0.436, Specular Roll Off to 0.350, Specular Color value to 0.547, Reflectivity to 0, and Reflected Color to Black.
Name it ‘atmosphereshader1’. Select atmosphere1Render layer, then ‘atmosphere1Geo’ and assign the shader.
Now that we have created all our shaders successfully, let’s render out some test scenes. First, go to Maya’s Render Settings, select Maya Software Render, and give it an Image size of 1,280 x 720 (or any resolution of your preference). In Maya Software settings tab, select the Contrast sensitive production preset under quality settings.
Now open up the render layers pane, and assign the screen blending mode, to citylights, clouds, atmosphere, and atmosphere1.
Hit render and all the render layers will be composited right inside Maya. Right now your render may look like this – clearly there’s still a lot to be tweaked.
We’ll use some remapHSV nodes to correct the colour issues that can be seen on the dark side of the earth. Open up the hypershade and graph the network of citylightsShader. Connect a remapHSV node between the citylights file texture, and the material. Open up the remapHSV attributes and adjust their graphs to match those shown. If needed, perform more colour corrections using the remapHSV node on your own for all the textures.
Now it’s time to render out everything we’ve done in Maya, but before that let’s quickly make a camera. Create a camera and look through it. Open it’s attributes and reduce the Camera Scale to 0.050, the Focal Length to 110.4, and the Near Clip Plane to 1. This creates a realistic scale relative to the Earth we just created.
Now lets create our render. Open up render settings and set a resolution of your preference. Enter a File Name Prefix and set the Image Format as Tiff16. Frame the camera in your viewport and Go to Render > Batch Render. Select Use All Available Processors. Hit Batch Render and close. All the rendered images will be stored in images folder of our project directory, and named after our render layers.
Open up Photoshop, and Place all your rendered images in one document. Set the blending mode for the ‘citylights’, ‘clouds’ and ‘atmosphere’ layers to Screen.
Duplicate the clouds layer, and put it below the original clouds in the layer stack. Invert it and set its blending mode to Multiply. Size it down to make it resemble cloud shadows.
Select the atmosphere layer and give it a Gaussian blur of 20. Select atmosphere1 layer and give it a Gaussian blur of 8. Lastly, add some contrast curves and our Earth is done.