Atmospheric Rendering of Outdoor Scenes

Manuel N. Gamito

Steve C. Maddock

The University of Sheffield

 

Rendering outdoor scenes is a complex task due to the many lighting effects that are present. Some of these lighting effects can be quite subtle and hard to notice at first. Others, such as Rayleigh scattering, make a drastic improvement in the rendering. This page shows a progression of images of a landscape with increasing visual realism. Each image in the progression adds a new atmospheric lighting effect to the mixture. For each effect that is added the realism improves but the computation time also increases. Often the scaling between rendering quality and computational expense is not linear – a particular effect may be quite expensive to compute and yet improve the rendering only in a small measure. This non-linearity motivates research on improving rendering algorithms that can reduce the computation time while not compromising rendering quality too much.

The major difference between outdoor rendering and indoor rendering is that, for indoor rendering, one does not need to worry about the presence of the atmosphere. Although the atmosphere is still there when one renders the interior of a room, the distances involved are quite short and the atmosphere does not have a chance to influence the lighting of the room. For all purposes, in indoor rendering, the atmosphere can be regarded as perfectly transparent and passive and one only needs to worry about the way that light bounces around on the surfaces of the furniture in the room. The only exceptions to this rule occur when there are significant concentrations of smoke or dust in the air of the room that are not normally part of the composition of the atmosphere. For outdoor rendering, the atmosphere becomes a significant part of the rendering equations. What makes realistic rendering for landscapes especially difficult is the large range of distances involved. Some terrain features can be quite close to the observer while others can be kilometres away, close to the horizon. A realistic outdoor rendering algorithm needs to account for all light interactions across this large range of scales.

 

Basic Setup


We use a procedural terrain, defined over a sphere, as the geometry to test the rendering of atmospheric lighting effects. As the name implies, a procedural terrain is defined by a procedure in a computer program that implements a function returning the height of the terrain for every point on the sphere. The function is fractal and is capable of generating terrain detail everywhere. The generation of the terrain over a sphere means that we are actually simulating an entire planet and, by controlling the size of the terrain features versus the size of the sphere, we can have the same sense of scale of terrain that one can find on Earth. We have placed the observer looking horizontally towards the horizon so that a very large range of terrain features becomes visible in the image. The sun was placed to the left of the observer and at a very low angle above the horizon. This creates the opportunity for the terrain to interfere with the propagation of light, creating shadows known as crepuscular rays. The image below illustrates the directions towards the observer and towards the sun for the set of images that we have rendered.

 

Local Lighting Model


A local lighting model accounts for the direct interaction of the light coming from a light source (the sun in this case) and the surface of the terrain. This is the simplest lighting effect that can be considered, if one wishes to see anything other than just a black picture. The light arrives from the sun, is reflected off the surface of the terrain and goes on towards the observer where it forms the image. We consider the terrain to be a perfect diffuse reflector, meaning that it reflects light equally in all directions. This is reasonably true for terrain but would be inappropriate if water was present either in lakes or oceans. Some terrain features can be seen in the image but the overall shape of the terrain is difficult to discern.

 

Surface Shadows


A local lighting model should only be applied for points on the terrain that are visible from the sun. If the light on a part of the terrain is blocked by other parts of the terrain, it does not make sense to evaluate the local lighting model there. This implies that, for every point on the terrain, it is necessary to trace a line towards the sun and check that this line does not touch any other part of the terrain. The parts of the terrain that are in shadow will be pitch black at this stage. The image, after shadows have been included, is still a bit confusing. If anything can be perceived it is that the sun is indeed at a very low angle above the horizon, due to the large amount of shadowing involved.

 

Rayleigh Scattering


This is where things start to get interesting. The atmosphere is made of gas molecules. The light is made of photons. When photons travel through the atmosphere they can collide with gas molecules and bounce off in a different direction to the one they were initially travelling. What is more, this bouncing effect is dependent on the wavelength (or colour) of the photons. Low wavelength (or blue) photons bounce more than high wavelength (or red) photons. With all those blue photons bouncing around in all directions, it is easy to understand why the sky appears blue. Rayleigh scattering introduces an important component to landscape rendering known as aerial perspective. The more distant a mountain is the bluish it looks and the less contrast it has against other nearby terrain features. Because the distance to far away mountains is greater, more blue photons can get in the way between the mountain and the observer, making the mountain look like it is blue. This effect gives a sense of depth to landscape renderings. Aerial perspective was discovered by the Italian painters of the Renaissance – notice the blueish mountains in the distance of Raphael's Mond Crucifixion.

.

 

Indirect Lighting Model


Right, we already considered light coming from the sun that reaches the terrain and is reflected directly towards the observer. What about light that is reflected multiple times across the terrain before finally going towards the observer? This forms the subject of indirect lighting models. They are more expensive than local lighting models and introduce subtle but important lighting effects. Indirect lighting models take into account the light that arrives at a point on the terrain, coming from all possible directions. Compare the shadow areas of the image below with the shadows of the previous images. Initially one could not see any terrain detail inside the shadows. Now, even parts of the terrain that are in shadow can still receive a small amount of light. This is indirect light that was either reflected from other parts of the terrain or scattered from the atmosphere and is then reflected towards the observer.

 

Atmospheric Shadows


Shadows affect not only the terrain but also the atmosphere. A photon cannot be scattered by an air molecule in the atmosphere if, when coming from the sun, it cannot reach that molecule in the first place. So, before applying Rayleigh scattering to a point on the atmosphere, we trace a line towards the sun and check that that point is not obscured by some part of the terrain. If it is, no Rayleigh scattering will occur at that point. Things are a bit more complex because, even if a part of the atmosphere is obscured by the terrain, it can still receive some photons that have bounced from other parts of the atmosphere but we will ignore this possibility at this point. We basically consider that the amount of photons that bounce at some point in the atmosphere after coming directly from the sun is much larger than the amount of photons that have come from previous atmospheric bounces. The situation is similar to the use of local or indirect lighting models that was discussed before – only now it is applied to light scattering in the air rather than light reflection on surfaces. Scattering models that account only for scattering by light that comes directly from the sun are said to be single-scattering. The inclusion of atmospheric shadows creates the appearance of shafts of light that are seen grazing over the ridges of the terrain at a low angle. These are know as crepuscular rays since they tend to occur mainly at sunrise or sunset.

 

Soft Surface Shadows


Even on a bright and cloudless day, the shadows cast by the sun on the ground are not sharp. There is a region of transition, called penumbra, between total shadow (or umbra) and the area of the ground not covered by shadows. This happens because the sun appears not as an infinitely small point but as a disk of a quite definite width in the sky. To get an idea, the size of the sun's disk is roughly equal to the size of a green pea, held at arm's length against the backdrop of the sky. So, for a given point on the ground, a piece of the sun's disk may be occluded by other parts of the terrain while the remaining unoccluded piece of the disk is still transmitting light to that ground point. The intensity of the shadow will be proportional to the occluded area relative to the total area of the sun's disk as seen from the ground. As the distance increases between the occluding part of the terrain (where the shadows are generated) and the part of the terrain where the shadows are cast, the width of the penumbra also increases, making the shadows look increasingly softer.

 

Things left undone


We stop our progression into ever increasing realism here as the rendering times are already getting to be quite long. The last image took about two days to render in parallel on 30 processors. This rendering time could have been significantly reduced if we had used optimised algorithms and data structures for light scattering and reflection. We used instead simple implementations for most of the effects with no optimizations considered. The most significant lighting effects have already been considered but there are many other effects that could have been included. Some of these are:

 

Other References


A good book on lighting phenomena in the atmosphere that does not use much technical language and is accessible to everyone is Minnaert's "The Nature of Light and Colour in the Open Air". It explains all the phenomena that we have presented here and plenty more.

Excellent photographs of atmospheric lighting effects can also be found in Les Cowley's Atmospheric Optics website. Some of the phenomena shown there are quite rare and difficult to photograph.