Skip to main content

CG Earth

Click to view larger

You may have noticed that my blog background changed a couple days ago. I've been meaning to change it for quite a while, but I didn't get around to it. Then, a few days ago, I had some free time on my hands. Why not create a 3D model of Earth, I wondered? So I pulled up Blender (a free computer graphics program I use) and got to work.


I actually wasn't entirely sure where to begin, but I had an idea of the basics. I needed to:
  • Map some terrain onto a sphere
  • Make an atmosphere
  • Create clouds
  • Prevent the clouds from looking like a weird shell around the planet
I'm not fully fluent in all the different techniques and features for Blender, so I looked for a planet Earth tutorial online. I soon found a BlenderGuru tutorial describing how to create and render a model of the planet Earth.

The problem with the tutorial is that it was for a different version of Blender, and as a result didn't do everything I wanted to do. I watched most of the tutorial, did some more Google searches, and figured out the rest on my own.

The final result consists of three layers of spheres of different sizes. It sounds pretty simple, but the important part is how I treat those layers.

The first layer is the actual surface of the planet. To make it as accurate as possible, I mapped NASA image data onto its surface. This required a total of 4 different images; I downloaded all but one of them directly from nasa.gov. The images were extremely large (many megabytes, many pixels), so I scaled them and compressed them until they were less than 5 MB each.

The main image, of course, is the following cloud-free "blue marble" map of earth's surface:

Land, sea, ice; used as a color image

I used this image to color the planet. NASA also included some other maps of the surface, but they were inaccurate because they did not include the polar ice caps, so I went with this one.

The next image I used was a map of surface topography. In this image, brighter pixels represent higher elevations and darker pixels represent lower elevations. I used the image as a normal map for shading. Basically, it puts shadows on the sides of mountains.

Topography; used for surface normals

The next image is a specularity mask. It's black where there's water, and white where there's land. I got this texture from blenderguru.com, because NASA didn't seem to have it. I used the image to determine which parts are reflective and which parts are not. The ocean should be shiny in sunlight, but the land should not.

Water map; used for specularity mask

Last but not least, I needed a map of city lights for the night side of the planet. I started with this image:

Earth at night

I started by mapping the image to the dark side of the planet. The problem is that the image also contains some blue, so the dark side of the planet was actually producing its own blue light. It didn't look bad, but it was unnatural. So uploaded the image to GIMP, where I removed the blue and converted to greyscale. This was the result:

City lights; used for light emission

...which is a map of the city lights, and practically nothing else. I used this final image to map some glowing points of light onto the dark side of the planet.

That finished the first layer. You might not have noticed all of those details, but the final result wouldn't have been the same without them.

The next layer is the cloud layer, which was much simpler. I only used one image:

Clouds, used for color, transparency, and surface normals

I used the image data for color as well as transparency and normal mapping. That way, the sphere is opaque where the clouds are, and transparent everywhere else. The clouds are also grey in places, and have a bumpy texture.

The next layer, the largest sphere, is the atmosphere. I didn't use any images for this sphere; instead, I used volume scattering to scatter blue light, and some math to make the atmosphere fade away at the edges. The resulting atmosphere is actually unrealistic – Earth's atmosphere doesn't extend this far from the surface. I decided to do it this way, though, because it looked better.

That's the basic idea for how I designed my 3D CG Earth. All I had to do next was add a background. Then, after rendering the final image, I applied JPEG compression in GIMP, and I was done.

So that's how I created the new background for my blog. What do you think? Comment below!


New posts every month – subscribe for free!


Comments

  1. Its great! I can barely see that its not real! Does blender make a new version every year?

    ReplyDelete
    Replies
    1. Thanks for commenting! Blender releases a new version whenever a new version is finished, which is usually every few months.

      So far this year they've released 2 versions. The new versions generally contain minor updates like bug fixes or speed improvements, but occasionally they'll add a big new feature like support for Cycles volume rendering.

      Delete
    2. Yea I was thinking about getting it but the last time I tried it had a virus.

      Delete
    3. Really? I don't think Blender has ever had any viruses, so it was probably a false positive. If you download the .exe directly from blender.org, you're safe.

      I read that some virus scanners were giving false positives because one of the filenames used by Blender is also commonly used by real viruses; that may be the issue. I've never had any trouble with Blender.

      Delete

Post a Comment

Popular posts from this blog

Dividing Paper Puzzle

When I was young, I would fold a sheet of letter paper in half, for origami projects. It occurred to me that the two halves looked almost the same as the whole sheet of paper - except they were smaller. I could see they weren't exactly the same shape; they were off by a little bit. But the idea stuck in my head. You can use a pen, instead of scissors, to halve the paper. Those rectangles all have the same shape, but are different sizes. One night when I was 12, I thought about my idea. I wondered if it was possible to have a sheet of paper that could be cut in half, resulting in 2 smaller versions of the same paper. That would be neat, to be able to cut a paper in half and get 2 papers that had the same exact shape. If that were possible, then you could cut  those  papers, too; and the resulting papers would have the same shape as all the other papers. You could keep cutting in half forever, and each paper, no matter how small, would have the same shape as all the others. I HAD to

Pluto No Longer on the Horizon

This morning, New Horizons became the first spacecraft to make a flyby observation of the Pluto system. During the mission, the spacecraft captured the most detailed photographs of Pluto's surface we've ever had, and possibly ever will have. It also found many new properties including size, mass, atmosphere, and surface composition. In a period of a few hours, we discovered more about Pluto than we've found in the 85 years since Clyde Tombaugh captured its first photograph. Before After  (images credit: NASA) To complete this mission, the spacecraft flew for more than 9 years through the emptiness of space. This may sound like a long time, but it's actually amazingly quick. In fact, New Horizons set the record for the fastest speed at launch, and during the flyby, the spacecraft was moving at a rate of over 30,000 mph, or roughly 50 times the speed of sound. Picture an object twice as heavy as a grand piano moving 25 times faster than a bullet from a gun. Yikes. The man

Gravity

Imagine the universe is filled with water. Instead of empty space, every inch of it contains pure water. No planets, no stars, only water. What happens? And what would happen if an air bubble formed? The answer to this question requires a basic understanding of gravity. Gravity is very important. It helps hold matter together, bends light, and distorts space-time (which, incidentally, is how it bends light). It also makes it possible to play football, and as Americans are big football fans, they would certainly agree that we couldn't live without it. Unfortunately, many Americans don't understand how gravity works. Admittedly, scientists haven't figured out a lot of things, but we do understand it well enough to make predictions and model physical events. One of the important things about gravity is that its strength is proportional to the inverse of the square of the distance. In other words, it gets weaker as you get farther away, based on the equation: F = c/d 2 where c