Lightning is a fascinating natural phenomenon, and recent research is giving us more insight into less commonly seen upper-atmospheric lightning phenomena such as Sprites, ELVES and Blue jets.
Shakespeare rings true once again in this quote from Hamlet: "There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy."
A journey to create a CG model of our beautiful
home planet
while learning more about
its wonders along the way...
Showing posts with label atmosphere. Show all posts
Showing posts with label atmosphere. Show all posts
Thursday, July 3, 2014
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 ^^;
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.
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.
In the next post, I'll talk about the various shaders.
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.814In the next post, I'll talk about the various shaders.
Labels:
atmosphere,
clouds,
making-of,
ocean,
scattering,
specular,
terminator,
WIPshots
Sunday, March 25, 2012
Seas and skies
In the last post I mentioned how my shaders crashed under the new version of Houdini. I'm glad to report that I have re-worked them to work with H12, and in the process deepened my understanding of VEX shader networks. I've also managed to remove the rendering artifacts and shader errors, mainly by not assuming that unconnected inputs will have the correct default values applied. Subsequently, I have also refined various aspects and added new features to my Earth shaders.
The two most significant additions are the simulation of forward scattering in the atmosphere and anisotropy in the specular highlight of the ocean, as seen in the following work-in-progress snapshots:
The two most significant additions are the simulation of forward scattering in the atmosphere and anisotropy in the specular highlight of the ocean, as seen in the following work-in-progress snapshots:
![]() |
| The atmosphere scatters more light as the Sun gets behind it, an effect attributed to Mie scattering of light by particles in the air |
Tuesday, November 8, 2011
Atmosphere development
After some research into physically based atmospheric models (Nishita... etc) I realized that while I understand the basic principles behind calculating optical depth, Rayleigh and Mie scattering, I don't have the necessarily Math or shader building skills to recreate them properly and optimally in Houdini. Yet :P
So meanwhile, I'm using an artist's approach. Essentially I'm "pre-computing" the scattering of different wavelengths as well as optical depth due to incident viewing angle and storing them as colors on a color ramp. It's really not as complicated as it may sound, and apparently it's a similar technique used by game programmers to render planetary atmospheres in real time (though I came up with the idea independently before reading about a similar method here).
There are two main components to the scattering:
The scattering is dependent on the optical depth through which sunlight travels within the atmosphere, and caused by small air molecules in the case of Rayleigh and larger particles and aerosols in the case of Mie. Generally, the more distance that light travels through the air/aerosols, the more the light attenuation and scattering effect. As more blue light gets scattering in all directions, the originally white light from the Sun appears more yellow, then red (during sunrise and sunsets). The actual calculations are further complicated by phase functions which are both light and view dependent, but I've attempted to incorporate those effects into the color ramps also.
Here's how I implemented the atmospheric scattering effects:
Looking at the entire planet from far, the optical depth is minimum at the center of the planet and gets thicker as we move toward the outer edge. This is characterized by less scattering in the middle and more scattering at the circumference, which can be easily approximated using an edge falloff function modulating the opacity of the atmosphere layer.
So far, this only captures the scattering component from points on the Earth's surface through the atmosphere toward the viewer's eye (Earth to Viewer). On top of this, we need to add a light dependent component, which is the scattering along the optical path from the Sun through the atmosphere to the point on the Earth's surface (Sun to Earth). Once again, I used an artist's "hack", employing the standard Lambertian dot product (L.N) and using the resultant to lookup another color ramp. This was used to achieve the "red terminator" characteristic of planets with red sunsets.
The last step would be to achieve the rim falloff from bright sky blue to the blackness of space, and I have chosen to recreate this using a separate layer from the atmosphere (which employs a multi-layered volumetric approach mentioned in this post). This is also achieved using an edge falloff function driving a color ramp:
In a later post I will explain how I implemented atmospheric density falloff based on altitude - i.e, the air gets thinner the higher up you go.
So meanwhile, I'm using an artist's approach. Essentially I'm "pre-computing" the scattering of different wavelengths as well as optical depth due to incident viewing angle and storing them as colors on a color ramp. It's really not as complicated as it may sound, and apparently it's a similar technique used by game programmers to render planetary atmospheres in real time (though I came up with the idea independently before reading about a similar method here).
There are two main components to the scattering:
- Rayleigh scattering which scatters blue wavelengths more than red, mostly responsible for blue skies and red sunsets.
- Mie scattering which scatters pretty much independently of wavelength, but with a strong bias towards forward scattering making the sky appear brighter around the Sun. This is really only significant if I were rendering a view of the sky from within planet's atmosphere, which I haven't planned on doing just yet :P
The scattering is dependent on the optical depth through which sunlight travels within the atmosphere, and caused by small air molecules in the case of Rayleigh and larger particles and aerosols in the case of Mie. Generally, the more distance that light travels through the air/aerosols, the more the light attenuation and scattering effect. As more blue light gets scattering in all directions, the originally white light from the Sun appears more yellow, then red (during sunrise and sunsets). The actual calculations are further complicated by phase functions which are both light and view dependent, but I've attempted to incorporate those effects into the color ramps also.
Here's how I implemented the atmospheric scattering effects:
Looking at the entire planet from far, the optical depth is minimum at the center of the planet and gets thicker as we move toward the outer edge. This is characterized by less scattering in the middle and more scattering at the circumference, which can be easily approximated using an edge falloff function modulating the opacity of the atmosphere layer.
![]() |
| Terminator redness has been exaggerated for visibility |
So far, this only captures the scattering component from points on the Earth's surface through the atmosphere toward the viewer's eye (Earth to Viewer). On top of this, we need to add a light dependent component, which is the scattering along the optical path from the Sun through the atmosphere to the point on the Earth's surface (Sun to Earth). Once again, I used an artist's "hack", employing the standard Lambertian dot product (L.N) and using the resultant to lookup another color ramp. This was used to achieve the "red terminator" characteristic of planets with red sunsets.
The last step would be to achieve the rim falloff from bright sky blue to the blackness of space, and I have chosen to recreate this using a separate layer from the atmosphere (which employs a multi-layered volumetric approach mentioned in this post). This is also achieved using an edge falloff function driving a color ramp:
| Color ramps - a CG artist's best friend when it comes to creating shaders without programming |
In a later post I will explain how I implemented atmospheric density falloff based on altitude - i.e, the air gets thinner the higher up you go.
Thursday, October 20, 2011
The air we breathe
One of the earliest goals I set out since the beginning was to have an atmosphere that is not simply a thin shell layer. It's an old trick, but by using multiple layers of closely packed concentric spheres and mapping opacity data onto each layer, a spatial sampling can be achieved which will allow the air to have apparent volumetric density.
Here are some early test shots (dated 3 Sept 2011). Imagine the spikes as mountainous terrain and the dense air forming clouds which gather at lower altitude:
Eventually, I moved on to another alternative method for rendering volumetric clouds, but until this day still have not found a satisfactory solution to create properly nice clouds for this project. More R&D ahead... ^^;;
Here are some early test shots (dated 3 Sept 2011). Imagine the spikes as mountainous terrain and the dense air forming clouds which gather at lower altitude:
![]() |
| While this technique has its value, it's a case of looking nice from afar, but being far from nice close up |
Eventually, I moved on to another alternative method for rendering volumetric clouds, but until this day still have not found a satisfactory solution to create properly nice clouds for this project. More R&D ahead... ^^;;
Subscribe to:
Posts (Atom)










