Blender 2.5: Detailed Render of the Earth from Space

Exclusive offer: get 50% off this eBook here
Blender 2.5 HOTSHOT

Blender 2.5 HOTSHOT — Save 50%

Challenging and fun projects that will push your Blender skills to the limit

$26.99    $13.50
by John E. Herreño | May 2011 | Open Source Web Graphics & Video

Home sweet home. We've got a very beautiful planet to live in, with lots of beautiful landscapes to look at; but maybe the most beautiful ones are those that we can see in the pictures taken from the space. Those are really awesome. In this article by John E. Herreño, author of Blender 2.5 HOTSHOT, let's challenge ourselves and work to create an image resembling some of that beauty that we can see in nature.

 

Blender 2.5 HOTSHOT

Blender 2.5 HOTSHOT

Challenging and fun projects that will push your Blender skills to the limit

        Read more about this book      

(For more resources on Blender, see here.)

Mission Briefing

Our purpose is to create a very detailed view of the earth from space. By detailed, we mean that it includes land, oceans, and clouds, and not only the color and specular reflection, but also the roughness they seem to have, when seen from space.

For this project, we are going to perform some work with textures and get them properly set up for our needs (and also for Blender's way of working).

What Does It Do?

We will create a nice image of the earth resembling the beautiful pictures that are taken from orbiting of the earth, showing the sun rising over the rim of the planet. For this, we will need to work carefully with some textures, set up a basic scene, and create a fairly complex setup of nodes for compositing the final result.

In our final image, we will get very nice effects, such as the volumetric effect of the atmosphere that we can see round its rim, the strong highlight of the sun when rising over the rim of the earth, and the very calm, bluish look of the dark part of the earth when lit by the moon.

Why Is It Awesome?

With this project, we are going to understand how important it is to have good textures to work with. Having the right textures for the job saves lots of time when producing a high-quality rendered image.

Not only are we going to work with some very good textures that are freely available on the Internet, but we are also going to perform some hand tweaking to get them tuned exactly as we need them. This way we can also learn how much time can be saved by just doing some preprocessing on the textures to create finalized maps that will be fed directly to the material, without having to resort to complex tricks that would only cause us headaches.

One of the nicest aspects of this project is that we are going to see how far we take a very simple scene by using the compositor in Blender. We are definitely going to learn some useful tricks for compositing.

Your Hotshot Objectives

This project will be tackled in five parts:

  1. Preprocessing the textures
  2. Object setup
  3. Lighting setup
  4. Compositing preparation
  5. Compositing

Mission Checklist

The very key for the success of our project is getting the right set of quality images at a sufficiently high resolution. Let's go to www.archive.org and search for www.oera.net/How2.htm on the 'wayback machine'. Choose the snapshot from the Apr 18, 2008 link. Click on the image titled Texture maps of the Earth and Planets. Once there, let's download these images:

  • Earth texture natural colors
  • Earth clouds
  • Earth elevation/bump
  • Earth water/land mask

Remember to save the high-resolution version of the images, and put them in the tex folder, inside the project's main folder.

We will also need to use Gimp to perform the preprocessing of the textures, so let's make sure to have it installed. We'll be working with version 2.6.

Preprocessing the Textures

The textures we downloaded are quite good, both in resolution and in the way they clearly separate each aspect of the shading of the earth. There is a catch though—using the clouds, elevation, and water/land textures as they are will cause us a lot of headache inside Blender. So let's perform some better basic preprocessing to get finalized and separated maps for each channel of the shader that will be created.

Engage Thrusters

For each one of the textures that we're going to work on, let's make sure to get the previous one closed to avoid mixing the wrong textures.

Clouds Map

  1. Drag the EarthClouds_2500x1250.jpg image from the tex folder into the empty window of Gimp to get it loaded.
  2. Now locate the Layers window and right-click on the thumbnail of the Background layer, and select the entry labeled Add Layer Mask... from the menu. In the dialog box, select the Grayscale copy of layer option. Once the mask is added to the layer, the black part of the texture should look transparent.
    If we take a look at the image after adding the mask, we'll notice the clouds seem to have too much transparency. To solve this, we will perform some adjustment directly on the mask of the layer.
  3. Go to the Layers window and click on the thumbnail of the mask (the one to the right-hand side) to make it active (its border should become white). Then go to the main window (the one containing the image) and go to Colors | Curves.... In the Adjust Color Curves dialog, add two control points and get the curve shown in the next screenshot:

    The purpose of this curve is to get the light gray pixels of the mask to become lighter and the dark ones to get darker; the strong slope between the two control points will cause the border of the mask to be sharper.

  4. Make sure that the Value channel is selected and click on OK.
    Now let's take a look at the image and see how strong the contrast of the image is and how well defined the clouds are now.
  5. Finally, let's go to Image| Mode| RGB to set the internal data format for the image to a safe format (thus avoiding the risk of having Blender confused by it). Now we only need to go to File| Save A Copy... and save it as EarthClouds.png in the tex folder of the project. In the dialogs asking for confirmation, make sure to tell Gimp to apply the layer mask (click on Export in the first dialog). For the settings of the PNG file, we can use the default values. Let's close the current image in Gimp and get the main window empty in order to start working on the next texture.

Specular Map

  1. Let's start by dragging the image named EarthMask_2500x1250.jpg onto the main window of Gimp to get it open. Then drag the image EarthClouds_2500x1250.jpg over the previous one to get it added as a separate layer in Gimp.
  2. Now, we need to make sure that the images are correctly aligned. To do this, let's go to View| Zoom| 4:1 (400%), to be able to move the layer with pixel precision easily. Now go to the bottom right-hand side corner of the window and click-and-drag over the four-arrows icon until the part of the image shown in the viewport is one of the corners. After looking at the right place, let's go to the Toolbox and activate the Move tool. Finally, we just need to drag the clouds layer so that its corner exactly matches the corner of the water/land image. Then let's switch to another zoom level by going to View| Zoom| 1:4 (25%).
  3. Now let's go to the Layers window, select the EarthClouds layer, and set its blending mode to Multiply (Mode drop-down, above the layers list).
  4. Now we just need to go to the main window and go to Colors| Invert.
  5. Finally, let's switch the image to RGB mode by going to Image| Mode| RGB and we are done with the processing. Remember to save the image as EarthSpecMap.jpg in the tex folder of the project and close it in Gimp.

The purpose of creating this specular map is to correctly mix the specularity of the ocean (full) with one of the clouds that is above the ocean (null). This way, we get a correct specularity, both in the ocean and in the clouds. If we just used the water or land mask to control specularity, then the clouds above the ocean would have specular reflection, which is wrong.

 

Bump Map

The bump map controls the roughness of the material; this one is very important as it adds a lot of detail to the final render without having to create actual geometry to represent it.

  1. First, drag the EarthElevation_2500x1250.jpg to the main window of Gimp to get it open. Then let's drag the EarthClouds_2500x1250.jpg image over the previous one, so that it gets loaded as a layer above the first one.
  2. Now zoom in by going to View| Zoom| 4:1 (400%). Drag the image so that you are able to see one of its corners and use the move tool to get the clouds layer exactly matching the elevation layer. Then switch back to a wider view by going to View| Zoom| 1:4 (25%).
  3. Now it's time to add a mask to the clouds layer. Right-click on the clouds layer and select the Add Layer Mask... entry from the menu. Then select the Grayscale copy of layer option in the dialog box and click Add.
    What we have thus far is a map that defines how intense the roughness of the surface in each point will be. But there's is a problem: The clouds are as bright as or even brighter than the Andes and the Himalayas, which means the render process will distort them quite a lot. Since we know that the intensity of the roughness on the clouds must be less, let's perform another step to get the map corrected accordingly.
  4. Let's select the left thumbnail of the clouds layer (color channel of the layer), then go to the main window and open the color levels using the Levels tool by going to Colors| Levels.... In the Output Levels part of the dialog box, let's change the value 255 (on the right-hand side) to 66 and then click on OK. Now we have a map that clearly gives a stronger value to the highest mounts on earth than to the clouds, which is exactly what we needed.
  5. Finally, we just need to change the image mode to RGB (Image| Mode| RGB) and save it as EarthBumpMap.jpg in the tex folder of the project.

Notice that we are mixing the bump maps of the clouds and the mountains. The reason for this is that working with separate bump maps will get us into a very tricky situation when working inside Blender; definitely, working with a single bump map is way easier than trying to mix two or more. Now we can close Gimp, since we will work exclusively within Blender from now on.

Objective Complete - Mini Debriefing

This part of the project was just a preparation of the textures. We must create these new textures for three reasons:

  • To get the clouds' texture having a proper alpha channel; this will save us trouble when working with it in Blender.
  • To control the spec map properly, in the regions where there are clouds, as the clouds must not have specular reflection.
  • To create a single, unified bump map for the whole planet. This will save us lots of trouble when controlling the Normal channel of the material in Blender.

Notice that we are using the term "bump map" to refer to a texture that will be used to control the "normal" channel of the material. The reason to not call it "normal map" is because a normal map is a special kind of texture that isn't coded in grayscale, like our current texture.

Blender 2.5 HOTSHOT Challenging and fun projects that will push your Blender skills to the limit
Published: June 2011
eBook Price: $26.99
Book Price: $44.99
See more
Select your format and quantity:
        Read more about this book      

(For more resources on Blender, see here.)

Object Setup

For this project, we are going to need a very simple scene—two objects, a camera, and a very basic lighting setup. The real magic will be done by using the compositor. To guide our steps, let's take a look at a screenshot showing the finished scene:

Blender 2.5: Detailed Render of the Earth from Space

The previous screenshot clearly shows the two objects (a sphere and a disc), the camera, and the three lights used for the scene. In this task, we will work on setting up the two objects.

Prepare for Lift Off

Let's open Blender, select and delete the default cube and light (keep the camera), and then save the file as earth.blend in the project's working directory.

Engage Thrusters

  1. Start by making sure that the 3D Cursor is located at the origin of the 3D world by going to View| Align View| Center Cursor and View All (or by pressing Shift + C).
  2. Now let's add a UV Sphere (Add| Mesh| UV Sphere) and leave the settings at their default values. Now go to the Object tab of the Properties Editor and set some properties as follows:
    • Name: planetEarth (first text entry)
    • Z Rotation: -148.85º (Transform panel)
    • Layers: 1 (disable any other layer, Relations panel)
  3. To get a softer appearance for the sphere, let's set its shading to Smooth (Tool Shelf sidebar) and add a Subdivision Surface modifier (Modifiers tab of the Properties Editor); make sure the Subdivisions Level for Render is 2.
  4. With the basic settings for the object in place, let's go to the Material tab of the Properties Editor, add a new material, set its name to earth, and set it as follows:
    • Diffuse color: 0.0 Red, 0.0 Green, 0.0 Blue (Diffuse panel)
    • Specular panel:
      • Color: 1.0 Red, 0.95 Green, 0.88 Blue
      • Specular Shader Model: Blinn (drop-down menu)
      • Intensity: 0.0
      • Hardness: 40
      • IOR: 10.0

    This will give us a basic material to play with. Notice that the diffuse color was set to black (zero), which means that we are going to add the color from the diffuse texture. The same logic will be applied to the specular intensity; we set it to 0 in the material level to drive it by using a texture in the additive blend mode.

  5. Now let's go for the texture setup. Go to the Texture tab, add a new texture, change its name to 'diff', its type to Image or Movie, and set it as follows:
    • Mapping panel:
      • Projection: Sphere
      • Offset: 1.5 X
    • Image panel:
      • Load the image EarthMap_2500x1250.jpg from the tex folder
    • Influence panel:
      • Diffuse color: Enabled, 1.0
      • Blend mode: Add

    We just perform the normal sphere mapping of the texture and add its color values to the diffuse color channel. The offset in the mapping is used to get the preview showing a part of the map that will allow us to easily check that the textures are working correctly.

  6. The second texture must be called 'spec', its Type set to Image or Movie, and we can set it as follows:
    • Mapping panel:
      • Projection: Sphere
      • Offset: 1.5 X
    • Image panel:
      • Load the image EarthSpecMap.jpg
    • Influence panel:
      • Specular Intensity: enabled, 1.0
      • Blend: Add
    • Image Sampling panel:
      • Use Alpha: Disabled

    This time we use one of the textures created by properly mixing the original ones. The only difference with the previous settings is that this texture will affect the specular intensity, and that we also disabled the use alpha option, since keeping it enabled would cause Blender to apply it incorrectly. Let's take a look at the preview panel (make sure to view it using a sphere) and see how the ocean has the correct specular intensity applied, whilst the earth doesn't have specular reflection at all.

  7. The third texture must be named 'clouds' and its Type set to Image or Movie; the remaining settings are as follows:
    • Mapping panel:
      • Projection: Sphere
      • Offset: 1.5 X
    • Image panel:
      • Load the image EarthClouds.png
      • Premultiply: Enabled
    • Influence panel:
      • Diffuse color: Enabled, 1.0
      • Blend mode: Mix
    • Use Alpha: Enabled (Image Sampling panel)

    The clouds texture is also straightforward. As we have an image with a proper alpha channel, we just need to enable its use and everything works correctly. Notice the usage of the Premultiply option in the Image panel. This is commonly needed for PNG images to be handled correctly by Blender.

  8. The fourth and last texture for this material must be named 'bump', its Type set to Image or Movie, and its other settings made as follows:
    • Mapping panel:
      • Projection: Sphere
      • Offset: 1.5 X
    • Image panel:
      • Load the image EarthBumpMap.jpg
    • Influence panel:
      • Normal: Enabled, -0.1
      • Blend: Mix

    As we can see, the bump map texture is applied to the Normal channel of the material. Notice that we use a negative value to get the correct effect.
    That's it for the planetEarth object. As we have very good quality textures, we just need to map them properly without having to create complicated setups. Now is a good time to save the file.
    Once done with the planet, let's create the disk that will allow us to create the atmospheric effect.

  9. Go to the 3D View and add a new circle (Add| Mesh| Circle; remember to be in Object Mode). In the settings for the circle (Tool Shelf, lower part), let's set the vertices value to 12 and enable the fill option to get a disc. Now let's go to the Object tab in the Properties Editor and set it as follows:
    • Name: atmosphere
    • Transform panel:
      • Location: -0.597 X, 0.488 Y, -0.429 Z
      • Rotation: 61.744º X, 0.054º Y, 51.069º Z
      • Scale: 1.256 X, 1.256 Y, 1.256 Z
    • Relations panel:
      • Layers: 2 (unset any other layer)
      • Pass index: 1
  10. We just need to set one more thing for this object to get it ready: Go to the Modifiers tab in the Properties Editor, add a Subdivision Surface modifier, and set its Render Subdivisions Level to 3. That's all we need for this object.
  11. Let's now set up the camera properly; select it, then go to the Object tab in the Properties Editor and set it as follows:
    • Transform panel:
      • Location: 3.041 X, -2.669 Y, 2.351 Z
      • Rotation: 60.129º X, 0º Y, 48.157º Z

Now let's switch to Camera View (View| Camera) to take a look at the planetEarth and atmosphere objects.

Objective Complete - Mini Debriefing

In this task, we worked exclusively on setting up the objects for our scene. Even though we have only two objects, setting them up required some work, as we need detailed material.

The more complex object in our scene is just a basic UV Sphere with a material having textures for various channels—diffuse, specular, and normal. Now we see how useful it was to perform the preprocessing on the textures. The set up of the material was very straightforward, sparing us the trouble of playing around with exotic tricks.

Lighting Setup

We'll be using a very basic lighting setup, using the classic technique with three lights—key, fill, and rim. For the key light, we'll be using an Area lamp to take advantage of the softness of its 'light'. The fill and rim lights will be just spot lights used because of the cone shape their 'lights' conform to, allowing us to focus directly on the main sphere.

Engage Thrusters

  1. Let's start by adding an Area Lamp (Add| Lamp| Area), then go to the Object tab in the Properties Editor and set it as follows:
    • Name: key
    • Transform panel:
      • Location: -2.991 X, -0.533 Y, 0.024 Z
      • Rotation: -90.1º X, 30.604º Y, 80.551º Z
    • Layers: 1 (disable any other layer) (Relations panel)
  2. After setting the Object properties of the key lamp, let's go to the Object Data tab of the Properties Editor and set the lamp properties as follows:
    • Lamp panel:
      • Color: 1.0 Red, 0.85 Green, 0.63 Blue
      • Energy: 0.1
      • Distance: 30.0
      • Gamma: 1.0
      • This Layer Only: Enabled
      • Specular: Enabled
      • Diffuse color: Enabled
    • Area Shape panel:
      • Shape: Square
      • Size: 2.0
    • No Shadow (Shadow panel)

    What we did was set up a basic area lamp, using a low energy value (it's very close to the planetEarth object) and a warm color. We also enabled the This Layer Only option to get it to affect only the planetEarth object. This light will be the main one in our setup, thus the name 'key'.

  3. Now let's add the second light of the setup; go to Add| Lamp| Spot, then go to the Object tab of the Properties Editor and set it as follows:
    • Name: fill
    • Transform panel:
      • Location: 7.62 X, -2.98 Y, 0.66 Z
    • Rotation: 85.35º X, -0.832º Y, 68.705º Z
    • Layers: 1 (disable any other layer, Relations panel)
  4. For the lamp properties, let's go to the Object Data tab in the Properties Editor and adjust the settings as follows:
    • Lamp panel:
      • Color: 0.067 Red, 0.106 Green, 0.218 Blue
      • Energy: 0.6
      • Falloff: Inverse Square
      • Distance: 25.0
      • This Layer Only: Enabled
      • Specular: Disabled
      • Diffuse: Enabled
    • Spot Shape panel:
      • Size: 45º
      • Blend: 0.15
    • No Shadow (Shadow panel)

    Notice that this time we use a spot lamp to get some blending effect from its cone shape. Notice also that the energy value seems to be higher than the one for the key light, but that's because area lamps are very sensitive to their energy value, so in reality the 'key' (area) lamp will have a stronger effect than the 'fill' (spot) one. The role of the fill light is to give a soft lighting to the area that the key light will not be affecting.

  5. To finish the lighting setup, let's add another Spot Lamp (Add| Lamp| Spot) and set its object properties as follows (Object tab in the Properties Editor):
    • Name: rim
    • Transform panel:
      • Location: -1.43 X, 6.85 Y, -4.31 Z
      • Rotation: 121.85º X, -6.75º Y, 187.66º Z
    • Layers: 1 (disable any other layer, Relations panel)
  6. The lamp properties (Object Data tab in the Properties Editor) must be set as follows:
    • Lamp panel:
      • Color: 0.067 Red, 0.105 Green, 0.218 Blue
      • Energy: 100.0
      • Falloff: Inverse Square
      • Distance: 25.0
      • This Layer Only: Enabled
      • Specular: Disabled
      • Diffuse: Disabled
    • Spot Shape panel:
      • Size: 45º
      • Blend: 1.0
    • No Shadow (Shadow panel)

This light will serve only the purpose of helping the viewer to know the shape of the planet more easily by lighting a thin border in the dark zone of the planetEarth object. Notice the very high value used for the energy.

Objective Complete - Mini Debriefing

The lighting setup that we created is a very common setup—a light acts as the main (key) light working as the primary light source. A second light is used to fill the areas that cannot be lit by the key light. Notice that the filling must be subtle to keep the idea of shadow. Finally, the rim light is needed to help the viewer in 'reading' the shape of the object, which is very important to separate the main subject from the rest of the scene.

The nice thing about compositing is that we don't have to put much effort into the scene; but just make sure that it offers enough richness to be used as the starting point for compositing.

Compositing Preparation

The setup that we are going to create is a bit complex, so we better perform some preparation tasks in advance. Let's start by looking at a diagram summarizing the general structure and defining some notation to aid in understanding the written explanation.

Notice the three different kinds of blocks used in the previous diagram. They are needed to understand better the individual screenshots of each part of the setup, as we see them. The RenderLayer and Mix blocks are individual nodes. But the blocks of type Row of nodes represent a group of nodes connected in a straight row. The reason to use multiple RenderLayer nodes (remember that we only have one RenderLayer set up in the scene) is to avoid having connections coming from the very left-hand side to the right-hand side, which would make it very difficult for us to understand the setup.

Having seen the simplified version of the node setup, let's take a look at the actual, finished setup, as shown in the following screenshot:

Blender 2.5: Detailed Render of the Earth from Space

Let's take a couple of minutes to compare this screenshot with the previous diagram, to make sure the general structure of the setup is completely understood. It is suggested to identify each group of nodes by their different heights, to make it easy to recognise each one of them in their individual screenshots.

 

Now let's work on the current task, which is just performing some preparation steps before creating the actual node setup; namely the configuration of the Render Layer (Render tab of the Properties Editor) and the creation of a group of nodes to be duplicated later.

Engage Thrusters

At this point, we're almost done with the scene setup, the only things we need to do are setting the world background to black and adjusting some settings for the compositing.

  1. To set the background color for the world, we just need to go to the World tab of the Properties Editor and set the Horizon Color to entirely black.
    The final details of the scene setup are required for feeding the compositing setup with the correct data and telling Blender to use the composite result instead of the raw render.
  2. Let's go to the Render tab of the Properties Editor and adjust the settings as follows:
    • Layers panel:
      • Scene: layers 1 and 2
      • Layer: layers 1 and 2
      • Passes: enable Combined, Z, and Object Index
    • Dimensions panel:
      • Resolution: 1920 X, 1080 Y, 100%
    • Post Processing panel:
      • Compositing: Enabled

    The only special things we need to do here are to include the Object Index pass (needed to extract the atmosphere object in the compositing) and making sure the render pipeline will take into account the compositing setup that we'll be creating. For the render size, we set values that play well with the settings in the compositing nodes that we'll create.

  3. Let's also rename the scene to 'earth-scene' before going on into the Node Editor.
  4. Now let's switch to the Compositing screen of our file by using the drop-down menu that is immediately on the right-hand side of the Help entry of the main menu. In the Node Editor, let's enable the Compositing nodes option in the header of the editor (located in the bottom of it) and also enable Use Nodes.
  5. Then let's disconnect the link between the default render layer node and the composite node (drag it away from the input of the Composite node) and move the composite node to the right-hand side.
  6. Create three nodes without connecting them to the main flow of the setup. The reason to do this is because this group is used in three different places of the setup. We can create a small 'template' to easily duplicate it later. Let's look at the following screenshot, showing the group alone:

    Blender 2.5: Detailed Render of the Earth from Space

    To create this group of nodes we just need to add three nodes:

    • Add| Convertor| ColorRamp
    • Add| Convertor| Set Alpha
    • Add| Convertor| Alpha Convert
  7. Once the three nodes have been created, let's connect the image output of the ColorRamp node into the Image input of the Set Alpha node, then connect the image output of the Set Alpha node into the Image input of the Alpha Convert node.
  8. Now, let's select the three nodes (Shift + right-click) and duplicate them twice (Shift + D) to get three distinct copies. Don't forget to move the new copies to get them clearly separated.
  9. Once the three copies are created, let's select the three nodes of the first copy, create a group (Ctrl + G), and set its name to controlledGlow1. Then let's create two more groups with the other two duplicates and name them controlledGlow2 and controlledGlow3, respectively. It is important to duplicate the nodes before grouping them, since the three groups will have different settings. Keep the groups around to be used later when needed in the setup.

Objective Complete - Mini Debriefing

This task was just about performing a few miscellaneous tasks that will get our scene ready for the compositing setup that we'll be creating in the next task.

We started by performing some general scene configuration by setting up the World options and the Render Layers. Then we switched to the Node Editor and created a template for a group of nodes that will be used in the final setup.

Classified Intel

This time we worked on creating three Node Groups, which is a very nice way of "packaging" some nodes into a "group" node. This has the obvious advantage of giving the setup the appearance of being simpler than it actually is. But there is a more powerful reason to create node groups—the ability to reuse them later, both in the current file and in other files.

Node groups are saved as datablocks that can be browsed when using the Append or Link command, which helps a lot when we want to "copy" some functionality from a previous node setup or even to have a nicely organized and helpful library containing groups of nodes for doing common tasks.

Blender 2.5 HOTSHOT Challenging and fun projects that will push your Blender skills to the limit
Published: June 2011
eBook Price: $26.99
Book Price: $44.99
See more
Select your format and quantity:
        Read more about this book      

(For more resources on Blender, see here.)

Compositing

The scene is fully set up and ready for the final task—compositing. If we render the scene as it currently is, the result will be quite boring, but the good news is that we can take it to the next level by applying some nice compositing love.

Engage Thrusters

Now we can start building the real setup. Let's start with the "A" group of nodes:

Blender 2.5: Detailed Render of the Earth from Space

  1. To create this row, let's start by panning the view to see the Render Layers node, then add an ID Mask node (Add| Convertor| ID Mask), connect the IndexOB output of the Render Layers node to the ID value input of the ID Mask, then set the Index parameter to 1 (the ID of the atmosphere object). Now add a Blur node (Add| Filter| Blur), connect the Alpha output of the ID Mask to the Image input of the Blur, and set the type of blur to Fast Gaussian and the X and Y radii to 20.
    Finally, let's add an RGB Curves node (Add| Color| RGB Curves), connect the Image output of the Blur node to the Image input of the RGB Curves node, and set the curve for the "C" channel, as shown in the previous screenshot. Let's remember that the Image output of the RGB Curves node is the output that will be connected to the "A1" and "A2" rows of nodes.
    Now, let's create the "A1" row of nodes; the following screenshot will give us the guidance we need:

    Blender 2.5: Detailed Render of the Earth from Space

  2. To create this row, let's start by adding a Blur node (Add| Filter| Blur), then set its type to Fast Gaussian and both the X and Y values to 60. Right after that, let's create an RGB Curves node (Add| Color| RGB Curves) and set its curve for the "C" channel as shown in the previous screenshot. Then let's select and duplicate the Blur node we created previously and move it to the right, after the RGB Curves node.
    Finally, let's connect the image output of the "A" row into the image input of the first Blur node, then connect the image output of the first Blur node into the image input of the RGB Curves, and the image output of the RGB Curves to the image input of the Blur node.

    While creating the nodes, you may notice the small thumbnails shown in the screenshots do not appear. This is because the scene hasn't been rendered yet. Once we get to render it for the first time, the compositing pipeline will get the data to work with and the thumbnails will be shown accordingly.

  3. The "A2" row will just be one of the groups of nodes we created in the very beginning, let's take the controlledGlow2 group and move it right below the "A1" row. Next, connect the image output of the "A" row both to the Fac and the Alpha inputs of the controlledGlow2 node group.
  4. Now we need to edit the internal ColorRamp of this group. Let's select it and hit the Tab key to access the internal nodes of the group. Select the ColorRamp node and edit it as follows:
    • Interpolation: Ease
    • Color stop 1:
      • Color: 0.0 Red, 0.328 Green, 1.0 Blue
      • Position: 0.068 (the left border of the "a" of "Ease" is a good guide)
    • Color stop 2:
      • Color: 0.457 Red, 1.0 Green, 0.907 Blue
      • Position: around 0.71 (the left-hand side border of the second "e" of "Delete" is a good guide)

    Once done with the ColorRamp, let's finish editing it by pressing the Tab key.
    Next, we must work on the "B" row of nodes. Let's see the next screenshot for it:

    Blender 2.5: Detailed Render of the Earth from Space

  5. For this row, we start by adding a Render Layers node (Add| Input| Render Layers), then a Hue Saturation Value node (Add| Color| Hue Saturation Value), and set its Saturation value to 0.0, then we must add an RGB Curves node and set its curve for the "C" channel as shown in the screenshot.
    Next, let's add a Bilateral Blur node (Add| Filter| Bilateral Blur) and set its Iterations to 50, Color Sigma to 3.0, and Space Sigma to 6.5. Finally, let's take the controlledGlow1 node group and put it as the last node in the row.
    We must now connect the nodes: Let's connect the image output of the Render Layers node to the image input of the Hue Saturation Value node, then connect the image output of the Hue Saturation Value node to the image input of the RGB Curves node. Next, we connect the image output of the RGB Curves node to both the image and determinator inputs of the Bilateral Blur node.
    Finally, we must connect the image output of the Bilateral Blur node to both the Fac and Alpha inputs of the controlledGlow1 node group.
  6. For this node group, we must edit its internal ColorRamp, so let's select it. Hit the Tab key and make sure to set the ColorRamp as follows:
    • Interpolation: Ease
    • Color stop 1:
      • Color: 0.0 Red, 0.328 Green, 1.0 Blue
      • Position: 0.0
    • Color stop 2:
      • Color: 1.0 Red, 0.0 Green, 0.0 Blue
      • Position: around 0.43 (the right border of the "F" of "Fac" is a good guide)
  7. Let's go back to the normal editing of nodes by pressing Tab. Remember the output of the "B" row is the image output of the controlledGlow1 node group.
    Now it's time to work on the "A1A" row of nodes. Let's take a look at the corresponding screenshot:

    Blender 2.5: Detailed Render of the Earth from Space

  8. For this row, we need to add two RGB Curves nodes (Add| Color| RGB Curves) and a Glare node (Add| Filter| Glare). Let's edit the curve for the "C" channel of each RGB Curves node as shown in the previous screenshot and set the parameters of the Glare node as follows:
    • Glare Type: Streaks
    • Quality: High
    • Iterations: 5
    • Color Modulation: 0.5
    • Mix: 0.0
    • Threshold: 0.0
    • Streaks: 5
    • Angle Offset: 1.0
    • Fade: 0.985
  9. The connections are as follows: Connect the image output of the "A1" row to the image input of the first RGB Curves node, then connect the image output of the first RGB Curves into the image input of the Glare node. Finally, connect the image output of the Glare node into the image input of the second RGB Curves node of this row. This way we get the "A1A" row complete.
  10. The next row is "A1B". For this row, we are just going to use the controlledGlow3 node group, then open it (Tab) to access its internal ColorRamp node, and set it as follows:
    • Interpolation: Ease
    • Color stop 1:
      • Color: 0.135 Red, 0.024 Green, 0.0 Blue
      • Position: 0.0
    • Color stop 2:
      • Color: 0.924 Red, 0.998 Green, 0.005 Blue
      • Position: around 0.3 (the right border of the second "d" of "Add" is a good guide)
  11. Now let's get out from editing the controlledGlow3 node group by pressing Tab and make sure to connect the image output of the "A1" row to both the Fac and Alpha inputs of the controlledGlow3 node group.

The only task remaining to be done is to create and connect the mixing nodes. Let's start by looking at the following screenshot:

Blender 2.5: Detailed Render of the Earth from Space

  1. Let's start by duplicating an existing Render Layers node and moving it to be right below the controlledGlow3 node group.
  2. Add a Mix node (Add| Color| Mix), set its mode to Add, its Fac to 2.0, and connect the image output of the controlledGlow2 node group to the top image input. Then connect the image output of the controlledGlow1 output to the bottom image input.
  3. Next, let's add two more Mix nodes; set the first to Additive mode and its Fac to 5.0. Then connect the image output of the controlledGlow3 node group to the bottom image input and the image output of the Render Layers node to the top image input. For the other Mix node, set its mode to Add, its Fac to 0.5, and connect the image output of the Render Layers node to the top image input and the image output of the mix node with a Fac of 2.0 to the bottom image input.
  4. Now we need another Mix node; set it to Add mode and its Fac to 1.0; the top image input must be connected to the image output of the mix node with a Fac of 5.0 and the bottom image input must be connected to the mix node with a Fac of 0.5.
  5. To finish the setup, we only need to add a last Mix node, set its mode to Add, its Fac to 1.0, and feed it with the image output of the "A1A" row (top input) and the image output of the other mix node with a Fac of 1.0 (bottom input), as shown in the following screenshot:

    Blender 2.5: Detailed Render of the Earth from Space

  6. The last step is just connecting the image output of the last mix node to the image input of the composite node.

And that's it! Your full node setup is ready to process the rendered image and get it to look very nice!

Objective Complete - Mini Debriefing

In this part of the project, we worked exclusively on the node setup to create the final composite that will get our render looking very nice.

We start by generating a simple blurred version of the fragment of the atmosphere object that is visible in the rendered image by first extracting its mask from the render (ID Mask node), then blurring it, and finally performing a bit of tweaking with an RGB Curves node.

Row "A1" is used to generate another blurred version of the arc of the atmosphere object. But this time we perform a trick by first blurring, then applying a curve, and then blurring again. This way, we get a blurred image showing only the center of the arc, which we will use to simulate the sun 'rising' on the rim of the earth.

The purpose of row "A1A" is to take the result of row "A1" and convert it to a nice, strong highlight of the sun. First we apply a curve to increase the contrast a lot. Then we apply a glare filter to create the highlights and finally, we perform a small correction with another curve.

In row "B", we start by converting the rendered image to grayscale (Saturation to 0.0); we then perform a very strong darkening of the image with a curve followed by a Bilateral Blur filter that works almost the same as the common Blur filter, but tries to preserve the sharp borders of the image. Finally, we add a controlledGlow node group that works by taking the image and mapping it to a ColorRamp, thus converting the soft grayscale look into a very colorful one. Both controlledGlow2 and controlledGlow3 perform the exact same work as controlledGlow1; the only difference is that the ColorRamps settings on each one are different. The usage of the Set Alpha and Convert Alpha nodes is needed to get image buffers that are useful for the mixing process.

The five mix nodes that we used are all set to Add mode, as we are starting with an image that is mostly dark and need to get it to look colorful, and have some strong highlights. The value of the Fac parameter is raised depending on how strong the influence of the bottom image input should be.

It is highly recommended to use Viewer nodes to inspect the result of each node in the chain and understand clearly what the logic is that is driving it.

Classified Intel

In this part, we used two new nodes: The ID Mask and the Set Alpha. The ID Mask node is used to automatically generate a mask showing the silhouette of the object with the Object Index given as the parameter. As we set the object index to be different for the atmosphere object, we can extract it from the other objects with the use of an ID Mask node. The Set Alpha node serves the purpose of defining exactly how we want the alpha of an image to be. In this setup, we just used the same blurred images that were fed into the ColorRamps, mostly to avoid increasing the complexity but also because it really makes a lot of sense to use those grayscale images as alpha channels for the bright highlights that we created.

Mission Accomplished

We started with just a few very good textures and a basic scene and finished with a very nice final render of the earth. The main reason for having got so far with such a simple setup (except for the compositing part) is that we got to work with very good quality textures, very clean and well worked out. Once the textures provided us with a nicely mapped earth, having the three most important channels (diffuse, specular, and bump), we just had to work carefully on the compositing to finish the job. So, here it is, our final rendered image:

The resolution of our image even allows us to take a look at some fine details, which give the final render a very good appearance. Let's do it and look for beautiful spots on our rendered image.

You Ready To Go Gung HO? A Hotshot Challenge

After all this hard work, there are still some things that you can do to polish the final render even more:

  • How about adding a nice background? (There is a very nice star field map in the wayback machine copy of www.oera.net.)
  • The dark part of the earth is using the same diffuse map as the part of the earth that is being lit. However, it would be great if we applied the diffuse map showing how the cities of the earth are lit in the night to the dark side. This change would surely require major adjustments on the node setup for compositing.
  • The volumetric look of the rim of the earth should cover more than just the rim; it would be great to get it doing that.

Summary

In this article we worked to create an image resembling the beauty that we can see in nature.


Further resources on this subject:


About the Author :


John E. Herreño

John E. Herreño Velasco is a 27 year old who developed, at the early age of 13, a deep curiosity for the "magical" things that modern digital computers can do. He recently graduated as an Electronics Engineer from the National University of Colombia, which helped him understand how computers are built, and studied by himself some principles on software development to get to know how to get the most out of them. He became interested in Blender 3D after finding version 1.72 bundled in a magazine CD bought for a very different reason and has been learning since then from the awesome community of users hanging out on Internet forums and writing tutorials. Today, he's highly convinced of the power that Open Source Software and the business models around it have to improve the general quality of life in developing countries. But, above all, he's just a human being wanting to know and serve Jesus Christ.

Currently he spends most of his time working from home, doing Drupal web development and Blender Training, along with some custom software development.

I want to express my gratitude to my parents Ramiro and Lucela, my brother Wbeimar and my sister Dayana for being such a great blessing from God and the greatest encouragement I have found. I would also like to thank the team at Packt: Steven Wilding for starting this project and providing me some good guidance to outline the contents, Rebecca Sawant and Shubhanjan Chatterjee for their patience on my permanent missing of deadlines and Susmita Panda for the very good and clear feedback on the produced material. Finally, I would like to thank my current employer, García Iguarán Asociados S.A.S., for their continued support and encouragement on this project.

Books From Packt


Blender 2.5 Lighting and Rendering
Blender 2.5 Lighting and Rendering

Blender 3D 2.49 Architecture, Buildings, and Scenery
Blender 3D 2.49 Architecture, Buildings, and Scenery

Blender 2.5 Materials and Textures Cookbook
Blender 2.5 Materials and Textures Cookbook

Blender 3D 2.49 Incredible Machines
Blender 3D 2.49 Incredible Machines

Blender 2.5 Character Animation Cookbook
Blender 2.5 Character Animation Cookbook

Papervision3D Essentials
Papervision3D Essentials

Blender 2.49 Scripting
Blender 2.49 Scripting

Flash with Drupal
Flash with Drupal


Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software