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

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...

Flipping Quarters

Here's an interesting puzzle involving chance: A man in a park asks you to play a game with him. It's a form of gambling. To play, you must pay the man $5, then flip a coin repeatedly until you get heads. As soon as you get heads, you stop flipping. If you only flipped the quarter once, he'll give you $1. If you flipped it twice, you get $2. Three times, $4. Four times, $8. Each extra flip gets you twice as much money, so the longer it takes before you get tails, the more money you get. Should you play, if you have a lot of time and the man will play as many games as you want? How much money, on average, would you gain (subtracting the $5 fee)? I will give the solution in a later post .

Should Tau Replace Pi?

The digits of π, organized in a very new way Happy π-day! And happy π-month! Today's month and day - that is, March 14 or 3.14 - includes the first 3 digits of π. And today's month and year - March 2014 or 3.14 - also includes the first 3 digits of π. We won't have another double-day for π for the next 100 years, so enjoy this one! For the special occasion, I'm posting two π-related posts - one for π-month, and the other for π-day. In both posts, I'm setting the font size to approximately π * π + π + π. This is the first post, for π-month; to see the second, go to http://greatmst.blogspot.com/2014/03/pi-month-pi-day-post-2-5-common-pi-myths.html . In this post, I am including an essay I wrote about whether π or τ is the more superior constant. This was written for people who know very little about math, so the basic idea should be easy to understand even for people who are not mathematically inclined. Should Tau Replace Pi? A constant is any number or value that ne...