Topics

Thursday, June 21, 2012

Making of a Planet - Part 2

In this post, I'll be describing in more detail how the CG Earth is constructed.

The whole planet was broken down into several key components: land, water, clouds, atmosphere and an atmospheric "rim". The atmosphere has two components because it's not a true volumetric simulation, but a kind of hack ^^;


Land 

Nothing fancy here that's not been done for decades. A simple sphere primitive with polar (spherical) UV projection so that the Blue Marble textures can be wrapped around it. Of course, it's well known that the Earth is not a perfect sphere, but an oblate spheroid. This is approximated using an Equatorial radius of 6378.14km and Polar radius of 6356.75km

An early "making-of" montage showing the key components of the Earth setup

A displacement shader is used with elevation data to create the mountains and terrain above ground, and bathymetry data is used to create the ocean floor below sea level.

Water

This is just another sphere primitive with an ocean shader applied. Water reflects the sun with a much stronger specular glint than the land or clouds. In the final version, however, I ditched both the bathymetry and water components and instead included the ocean shader into the single land shader for the entire planet. This was done to optimize rendering since the sea is really not that transparent from space, therefore calculating displacement for the sea floor is a waste of render time.

Clouds

After much experimentation with various volumetric hacks, I eventually settled upon the same age old technique everyone else is using - a sphere (surprise, surprise) mapped with transparency data from NASA's cloud texture, with the same cloud map doubling as a displacement map to give the clouds actual thickness. On top of this, I added procedural noise for detail, since the cloud map is of noticeably lower resolution than the land texture. To be honest, I feel that I have failed in the implementation of this component most miserably, so future versions will likely be done differently.

Displacement mapping to give the clouds thickness; procedural noise to add detail

Atmosphere and Rim

Another key component that makes or breaks the look of a CG planet is the atmosphere. The atmosphere of the Earth interacts with sunlight to produce a multitude of lighting effects and localized color shifts. Indeed, it is reason why the sky is blue and why the Sun appears yellowish when viewed from the ground. 


No atmosphere
With atmosphere

The volumetric effect is created using a set of concentric sphere of increasing size and decreasing opacity. The Rayleigh scattering effects is creating using ramp lookup based on a modified Lambert angle. As the shading approaches the terminator, the light color turns reddish.



The other component is the atmospheric rim, which uses another ramp lookup to create the blue "outline" around the limb of the Earth.



I must confess the most of the effects are hacked - they are "physically informed", but not physically based. At this point in time I'm still researching true volumetric solutions for the clouds and true scattering for the atmosphere.

The sane Rayleigh ramp lookup is used to color the cloud layer. A crude but effective technique ^^;;

Size Matters

As mentioned previously, all modeling was done to relative scale as much as possible in the spirit of "realism". Initially I used a unit of 1km but the comparatively small details of Earth and the astronomical scale of the solar orbit appear to cause precision problems when rendering shadows. No amount of tweaking the raytracing bias worked. In the end, through trial and error I found that using a base unit of 10km seem to minimize the glitches. So, for example, instead of 6378.14 for the Equatorial radius, I used 637.814

In the next post, I'll talk about the various shaders.

3 comments:

  1. interesting work! I was creating my own model of the earth too. But I'm using the Terragen3 software, with this software you should not worry about the clouds, as are created procedural
    I like to see a last glimpse of his work here, what happened to your model of the Earth today?

    ReplyDelete
    Replies
    1. Hi Ariel, thanks for your interest. The results of my project can be seen at my Vimeo site https://vimeo.com/43713874

      Delete
    2. Very inspiring work! don't forget also to take a look at terragen 3 ;)

      Delete