POV-Ray Sky Sphere Example

Published on December 31, 2021 at 12:01 pm by LEW

Introduction

Below is a POV-Ray scene file to render a sky with light clouds above the  water.  While there are many much more complicated ways to get render this scene with better results, these are pretty good for a scene script that took about half an hour to write.

POV Ray Sky Sphere Example

You can copy and past this script directly, and it should work. No additional files (include, macro, etc) should be needed.

This file renders fairly fast , even on older computers. So it is quick and easy to adjust some of the parameters and see the results.

I have added comments to the script to provide some explanation of the various different parts.

The Script

/******************************************************************************
* Project Simple World Environment                                            *
*                                                                             *
* Author: Lee Wulff                                                           *
*                                                                             *
* Version: 0.0.1           Date: 30 DEC 2021                                  *
*                                                                             *
* Description: A Sky Sphere rendered with clouds, and a plane rendered as     *
* simulated water                                                             *
*******************************************************************************/

/******************************************************************************
* Global Settings                                                             *
******************************************************************************/

#version 3.7;                           // Specify POV-Ray interpreter version
global_settings {
    ambient_light rgb <0.1, 0.1, 0.1>  // Minimum illumination to dark areas
    assumed_gamma 1.0                  //need gamma for version 3.7 plus
} 

/******************************************************************************
* Global Scene Objects *
******************************************************************************/
camera {                       // One Unit above zero look level to
    location <0, 1, -10>       // the horizon, vary X and Z for 
    look_at <0, 1, 0>          // visualization adjustment
}

light_source {                 // White point light set at great
    <-1000, 1000, -1000>       // distance from viewing area. To the
    rgb <1, 1, 1>              // left (-x), up (+y) and behind (-z)
}
/******************************************************************************
* Scene Objects *
******************************************************************************/ 
sky_sphere { // Sky Sphere to generate background

    pigment { // For base sky sphere gradient 
        gradient <0,1,0>       // oriented in y direction (up/down)
        color_map {            // horizon whitish to blue peak
            [0.000 color rgb <0.3, 0.3, 1.0>]
            [0.001 color rgb <0.2, 0.2, 1.0>]
            [0.002 color rgb <0.1, 0.1, 1.0>]
        }
    }
    pigment {                 // For simulated clouds layered inside 
        bozo                  // sphere - smooth random noise function
            turbulence 0.9    // Two shades of white to transparent
            octaves 6         // to show blue sky behind.
            omega 0.7
            lambda 2
        color_map {
            [0.0 color rgb <1.0, 1.0, 1.0>]
            [0.2 color rgb <0.8, 0.8, 0.8>]
            [0.5 color rgbt <1.0, 1.0, 1.0, 1.0>]
        }
        scale <0.1, 0.5, 0.3>
        rotate -90*z
    }
}

plane {                      // Plane oriented at origin on X/Z axis
    <0,1,0>,                 // with Y perpendicular
    0
    material {
        texture {
            pigment {        // Base Water color
                color rgb <0.2, 0.2, 0.4> 
            }
            finish {            // Simulate mirrored finish, as most
                ambient 0.15    //water appearance characteristics come 
                diffuse 0.55    // from reflection
                brilliance 3.0
                phong 0.8
                phong_size 120
                reflection 0.3
            }
            normal{            // modify normal's to simulate disturbance
                bumps 0.5      // of water surface
                scale <1,0.25,0.25>
                turbulence 0.6
            } 
        }
    }
}

Conclusion

I hope this script inspires some of you to try working with POV-Ray. There are many different types of scenes that are probably easier to do in POV-Ray than some other 3d ray tracing programs.

Add New Comment

Your email address will not be published. Required fields are marked *