|
|
|||||||||||||||||
|
|
|
|||||||||||||||||
|
| The Inspiration
I have always loved Astronomy and Space Travel, and I wanted to create an image of our home planet. NASA has created some composite images of Earth next to the moon, and I liked that kind of view. In reality, the moon is quite distant from the Earth, which makes it difficult to choose a viewpoint without one of them looking too small. So I decided to create something that was more "surreal" than "realistic" in terms of appearance and relative distances. |
|
How was it created?
Rendering the Earth requires good texture maps of the continents. I searched online for some suitable images, and found some excellent textures as part of the Celestia 3D Space Simulator (highly recommended!). I used the textures shown below to create the planet Earth:
I created a 3-layer texture map with the base land and cloud cover textures, and the cloud cover image also used as a bump map. The height of the bump map is exaggerated greatly, but seemed to make the planet look better.
The city lights image provided subtle detail for the unlit side of the planet, which is defined below as a bit of a hack to display without any visible artifacts at the daylight boundary on the planet surface.
The Earth
Here is the planet Earth definition:
////////////////////////////////////////////////////////////////
// "earth.inc"
// Earth textures and display macros
// James Kuffner, Jr.
// July 2003
//
// Earth model
//
#declare PEarthBase =
pigment {
image_map {
jpeg "earth_land.jpg" // the file to read (iff/tga/gif/png/jpeg/tiff/sys)
map_type 1 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
} // image_map
}
#declare PEarthClouds =
pigment {
image_map {
jpeg "earth_clouds.jpg" // the file to read (iff/tga/gif/png/jpeg/tiff/sys)
map_type 1 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
//transmit all 0.5 // N=all or color index # (0...N), V= value (0.0...1.0)
} // image_map
}
#declare PEarthCityLights =
pigment {
image_map {
jpeg "earth_citylights.jpg" // the file to read (iff/tga/gif/png/jpeg/tiff/sys)
map_type 1 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
//transmit all 0.5 // N=all or color index # (0...N), V= value (0.0...1.0)
} // image_map
}
#declare NEarthBump =
normal {
bump_map { // uses image color or index as bumpiness
jpeg "earth_clouds.jpg" // the file to read (iff/tga/gif/png/jpeg/tiff/sys)
map_type 1 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
bump_size 0.2 // 0...3
} // bump_map
}
#declare TEarth =
texture {
pigment {
average
pigment_map {
[ 2.0 PEarthBase ]
[ 1.0 PEarthClouds ]
}
}
finish {ambient 0.001 diffuse 3.0 }
normal { NEarthBump }
}
#declare TEarthCityLights =
texture {
pigment { PEarthCityLights }
finish { ambient 0.9 diffuse 0 }
}
#declare Earth =
union {
sphere { 0, 1
texture { TEarth }
}
// overlay a thin city lights texture layer on the
// unlit half of the sphere
difference {
sphere { 0, 1.00001
texture { TEarthCityLights }
}
box {
<2, 2, 2>, <0, -2, -2>
rotate y*-43
}
}
}
The Moon
The moon was created using a sphere with layered textures. The base color is a color map with the wrinkle pattern, blended with a granite pattern to simulate the appearance of impact craters.
//
// Moon model
//
#declare PMoonBaseColor =
pigment {
wrinkles turbulence 0.2 scale 0.5
color_map { [0 rgb 1] [1 rgb 0] }
}
#declare PMoonCraters =
pigment {
granite scale 0.2
color_map{
[ 0 rgb 1 ]
[ 1 rgb 0 ]
}
}
#declare TMoon=
texture{
pigment {
average
pigment_map{
[0.85 PMoonBaseColor]
[0.15 PMoonCraters]
}
}
finish {ambient 0.001 diffuse 0.95 specular 0}
}
#declare Moon =
sphere { 0, 1
texture {TMoon }
}
The Stars
To define the background stars, I created a textured hollow sphere based on examples from some of the POV predefined skies. A blended texture layer of turbulent pigment provides some non-uniformity as interstellar space dust and gas.
// define a starry sky
//
#include "stars.inc"
#declare T_space_gas =
texture{
pigment {
bozo
turbulence 0.8 octaves 10
omega 0.5 lambda 2.5
color_map {
[0.0, 0.4 color rgbt<0, 0, 0, 1> color rgbt<.3, .3, .3, 0.8> ]
[0.4, 0.6 color rgbt<.3, .3, .3, 0.8> color rgbt<0.4, 0.3, 0.3, 1> ]
[0.6, 1.0 color rgbt<0.4, 0.3, 0.3, 1> color rgbt<0.4, 0.3, 0.3, 0.9> ]
}
}
finish { ambient 1 diffuse 0 }
}
// create a large, hollow sphere
sphere { 0, 10000
texture {
Starfield1
scale 40
finish { ambient 2 diffuse 0 }
}
texture {
T_space_gas
scale 2000
}
hollow
}
Final Touches
Nathan Kopp's lens flare macro provided a finishing touch. I did some initial experimenting and then settled on the final result on the right below:
1997 - 2008 © James Kuffner, Jr.