##################################
Adding Clouds to a Sky Light Shape
##################################

To add clouds to the sky light shape, simply call the ``RED::ISkyLightShape::AddClouds`` function after the creation of the sky. The clouds will appear on the final sky texture. The texture can later be added as background image.

.. code:: cpp

    RED::ISkyLightShape* isky = sky->As< RED::ISkyLightShape >();

    // Setup the sky model.
    RC_TEST( isky->SetPhysicalModel( 1.0, view_height, 1.0, 3, 0.1, 0.8, 0.7,
                                    sun_direction, 1.0, 1.0,
                                    moon_direction, 1.0, 1.0, 
                                    1.0, 0.6, iresmgr->GetState() ) );

    // Add the clouds layer.
    int cloudlayer;
    double cumulus_altitude = 1000.0;
    double cumulus_density = 0.2 * 1e6;
    double cumulus_intensity = 1.0;
    double cumulus_opacity = 0.8;
    RC_TEST( isky->AddClouds( cloudlayer, cumulus_altitude, cumulus_density, cumulus_intensity, cumulus_opacity, RED::CT_CUMULUS, 18081986, iresmgr->GetState() ) );

    // Setup the background image.
    RC_TEST( isky->CreatePhysicalSkyTexture( bg_tex, true, 0, false, true, true, iresmgr->GetState() ) );

For further explanations about the sky light shape, see :doc:`/book/subjects/bk_skymodel`.