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.

  1. Clouds

  2. 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]:

    1. High level clouds: Composed mostly of ice crystals.
      Cirrostratus: Appearance of a whitish veil which may totally cover the sky.
      Cirrus: Appearance of white, delicate filaments in patches or narrow bands.
    2. Mid-level clouds
      Altocumulus: occurs as a layer or patch with a wavy appearance and is typically white and/or gray.
    3. Low level clouds
      Nimbostratus: a gray colored and often dark cloud, accompanied by more or less continuously falling rain, snow, sleet, etc. and not by lightning, thunder, or hail.
      Stratocumulus: a low-level cloud in the form of a gray and/or whitish layer or patch, which nearly always has dark parts and is non-fibrous.
    4. Convective clouds: A cloud which develops vertically by convection.
      Cumulonimbus: Exceptionally dense and vertically developed cloud type, occurring both as isolated clouds and as a line or wall of clouds, and generally accompanied by heavy rain, lightning, and thunder.
      Cumulus (Nice weather cloud): cloud type in the form of individual, detached elements which are generally dense and have well-defined outlines.
    5. Hurricanes and tornadoes
    6. Other cloud types
      Contrails (condensation trail): streaks of condensed water vapor created in the air behind aircraft flying in clear, cold and humid air.
      Mammatus: cloud features resembling pouches which hang on the underside of a cumulonimbus cloud or a thunderstorm's anvil. Mammatus themselves are harmless and most likely to be seen after the worst of a thunderstorm has passed.

    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.

  3. Previous work

  4. Successful work has been done where a generated "noise texture" is mapped onto a set of spheres to create shapes of clouds [15]. 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.

  5. A new 2D method of generating clouds: Foggy Circles

  6. 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 scene.

    fig25.gif (2234 bytes)

    Figure 25: Detail of foggy circles showing how to calculate pixel value.

    It is possible to achieve a range of different effects by setting the number of circles, their size and the range of possible colors.

    fig26.gif (13735 bytes)

    Figure 26: Foggy circles

  7. Evaluation

  8. 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.

  9. A new method of modeling clouds: Smear circles

  10. This technique is useful to model Cumulus clouds, and works as follows:

    1. Shade the screen from dark blue at the top to bright blue or white at the bottom.
    2. Draw a number of filled circles in pairs. Each pair consists of one parent circle and a child circle. The child is on top of the parent at the lower corner. The child's diameter is approximately 1/3 of the parent's diameter.

    fig27.gif (393 bytes)

    Figure 27: Pair of parent child circles.

    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.

    1. Select two random pixels that are not more than six pixels apart in x-direction and three pixels in the y-direction. Swap the pixel values between the two pixels. Repeat this procedure a large number of times (more than 5000).

    fig28.gif (53292 bytes)

    Figure 28: Smear circles sunset.

  11. Evaluation

  12. 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.

  13. Intensity map

  14. This algorithm works just as the mountain generator algorithm, except that the height values generated are now the intensity of the clouds [18]. 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.

    fig29c.gif (25279 bytes) fig29b.gif (23060 bytes)
    fig29a.gif (43745 bytes)

    Figure 29: Sky pattern that can be used as a texture tile. The roughness parameter is set to (a) 0.6 (b) 0.7 (c) 0.8

    fig30.gif (4312 bytes)

    Figure 30: Pasting the sky texture onto the sky polygon.

    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 mountain generator.

  15. Evaluation

  16. 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.

    fig31.gif (3578 bytes)

    Figure 31: Faster cloud mapping by scaling.

    fig32.gif (15975 bytes)

    Figure 32: Texturemapped sky tiles.


anarule.gif (1534 bytes)


naprev_cmp.gif (1754 bytes)nahome_cmp.gif (1799 bytes)naup_cmp.gif (1668 bytes)nanext_cmp.gif (1698 bytes)