This chapter deals with different methods of generating images of
the clouds in the sky. The following section describes different clouds and some of their
properties. In the second part, there are three different methods for generating sky
images with different clouds.
Modeling the sky is a very complicated task, since there are so many different types of clouds. Following is a list of the most common clouds [9, 10, 11, 12]:
All these different clouds need many different approaches to model
them. Not only are there many different types of clouds, but one and a same cloud also
looks very different depending on the viewer's position. This thesis limits its contents
to discussing the high-, mid- and low-level clouds as they are seen from the earth when
looking towards the horizon.
Successful work has been done where a generated "noise
texture" is mapped onto a set of spheres to create shapes of clouds . Text on
generating clouds using fractals can be found at [16, 17]. A common way of creating sky
images is to use normal texture mapping [13, 14]. Since a sky could have a huge area, it
is often difficult to texture map the sky because a very large texture would be needed.
Therefore the texture is mapped to a vertical plane perpendicular to the viewpoint. When
the horizon is very close, this will be an acceptable simplification, when the clouds
extend far towards the horizon, the texture mapped clouds closest to the viewpoint will
look smaller, and the clouds closest to the horizon will appear larger. As this is not an
acceptable solution We have developed two methods which are not based on texture mapping.
A third method discussed is a modified version of texture mapping.
This is a very simple two dimensional method but is still worth
discussing, as it generates good results and models high level clouds and fog. A large
amount of circles are defined by their position on the screen, radius and color/density.
Each circle is placed at a random position on the screen (or by a user-defined area of the
screen). A random color is selected from a palette of shades between white and blue for
every circle. The radius is also selected at random where the user sets the limits. For
every pixel the set of circles containing the pixel is determined. The color of the pixel
is set to the average color of all circles that surround it. The number of circles must be
fairly large (greater than 1000) to conceal the outline of the circles in an average
It is possible to achieve a range of different effects by setting the number of circles, their size and the range of possible colors.
The parameters that this function will need are number and size of
circles plus range of colors. One problem with this technique is that the borders often
have sharp changes in color. This does not look realistic. If the borders can be hidden
this looks quite realistic. This method will only model fog and foggy clouds, but a range
of colors and thickness of the fog can be achieved. An 1024x768 image will take between
one and four minutes on a 100MHz 486 PC.
This technique is useful to model Cumulus clouds, and works as follows:
The size and color of the circles depend on where on the screen they
are drawn. The circles, higher up on the screen, are bigger and have brighter parent
circle and darker child circle. The circles lower down on the screen are smaller with
darker parent circle and brighter child circle.
The amount of circles and number of pixel swaps are the only inputs
that control the generation of clouds in the sky. Since this method is greatly affected by
the random values it might demand a few tries before a realistic image is created. Only
high-level clouds can be generated, but amount of clouds and strength of wind (controlled
by the number of pixel swaps) can be adjusted. The number of pixel swaps will also
determine the time it takes to generate an image. A good image will normally not take more
than one and a half minute to create on a 100MHz 486 PC.
This algorithm works just as the mountain generator algorithm, except that the height values generated are now the intensity of the clouds . In the same way as the sea level was used when creating mountain models, a cloud level is used to set the intensity where lower intensity values give blue sky and higher intensity values makes the clouds look light blue to white.
The images in Figure 29 are viewed looking straight up in the sky.
It is possible to use a modified version of the texture mapping to make it look like a
view towards the horizon. When normal texture mapping is done, a calculation is made to
determine from which pixel to copy the texture for every pixel in the sky polygon. The
mapping has to be scaled so that every pixel in the sky polygon is covered by at least one
pixel from the texture tile. This could be called a "fetch" method and requires
a very large texture to completely map the sky polygon. If a large texture is not
available, the repeatedness of the pattern will become apparent. The technique developed
in this thesis works in the opposite direction. The destination position in the sky
polygon will be calculated for every pixel of the generated texture tile. This is a
"paste" method. The average must be calculated when several pixels from the
texture tile end up at the same pixel in the sky polygon. Instead of using the same
texture tile over and over again, new texture tiles are generated as soon they are needed.
The technique used to extend the size of mountains (see 4.7 Section for A new method for
mountains: Extended size method) is used in order to do this. Since a new texture tile is
created when necessary, there will be no repeated patterns.
Since the area to which each texture is mapped is getting smaller and smaller the further away it is mapped, many pixels in the texture tile will cover the same pixel in the sky polygon. More and more texture tiles will also be needed in order to cover the whole screen. One of the properties of fractals is that they are zoomable. This phenomenon is used in this technique. Begin modified texture mapping at the area closest to the viewpoint, and expand towards the horizon. Scaling and/or sizing must be done so that each pixel in the horizontal row, closest to the viewpoint in the in the sky polygon, is covered by at least one pixel from the texture tile. As soon as at least two horizontal pixels from the texture tile are mapped to every pixel in the sky polygon, the mapping is scaled so that each texture tile now maps to a twice as large area in the sky polygon (Compare Figure 31 and Figure 30). This way all the areas of the sky polygon will be covered by the texture tile, and every sky tile will cover as large an area as possible. Every second value from the border array must be copied to the border of the next row of intensity squares when the mapping is scaled. As described in Section 4.3, the maximum displacement is multiplied by a roughness factor after every iteration of midpoint displacements (i.e. when the distance between nodes is halved, see Figure 15). Since the distance between the nodes is doubled, the maximum displacement should be divided with the roughness factor. This would mean that the maximum displacement could be greater than the user specified value. Consequently, the maximum displacement is set to the original maximum displacement and is not changed during the first x number of iterations, where x is the number of times the texturing has been scaled.
This technique creates a realistic sky with relatively small amount of computations.
The same kind of inputs are needed for this module as for the
The same parameters are needed as for the mountain generator
algorithm. Of the techniques described in this thesis is the this the one that generates
the most realistic clouds, but, as with the other approaches in the literature, only one
kind of clouds (See section 5.1) will be generated. The speed greatly depends on the size
of the texture mapped area. It can take up to ten minutes to create a large and detailed
sky on a 100MHz 486 PC.