Previous:Using Pattern Modifiers   Main Index   Next:Using Pigment Maps



Using Transparent Pigments and Layered Textures

Pigments are described by numerical values that give the rgb value of the color to be used (like color rgb<1,0,0> giving us a red color). But this syntax will give us more than just the rgb values. We can specify filtering transparency by changing it as follows: color rgbf<1,0,0,1>. The f stands for filter, POV-Ray's word for filtered transparency. A value of one means that the color is completely transparent, but still filters the light according to what the pigment is. In this case, the color will be a transparent red, like red cellophane.

There is another kind of transparency in POV-Ray. It is called transmittance or non-filtering transparency (the keyword is transmit). It is different from filter in that it does not filter the light according to the pigment color. It instead allows all the light to pass through unchanged. It can be specified like this: rgbt <1,0,0,1>.

Let's use some transparent pigments to create another kind of texture, the layered texture. Returning to our previous example, declare the following texture.

  #declare LandArea = texture {

      pigment {

        agate

        turbulence 1

        lambda 1.5

        omega .8

        octaves 8

        color_map {

          [0.00 color rgb <.5, .25, .15>]

          [0.33 color rgb <.1, .5, .4>]

          [0.86 color rgb <.6, .3, .1>]

          [1.00 color rgb <.5, .25, .15>]

        }

      }

    }

This texture will be the land area. Now let's make the oceans by declaring the following.

  #declare OceanArea = texture {

      pigment {

        bozo

        turbulence .5

        lambda 2

        color_map {

          [0.00, 0.33 color rgb <0, 0, 1>

                      color rgb <0, 0, 1>]

          [0.33, 0.66 color rgbf <1, 1, 1, 1>

                      color rgbf <1, 1, 1, 1>]

          [0.66, 1.00 color rgb <0, 0, 1>

                      color rgb <0, 0, 1>]

        }

      }

    }

Note how the ocean is the opaque blue area and the land is the clear area which will allow the underlying texture to show through.

Now, let's declare one more texture to simulate an atmosphere with swirling clouds.

  #declare CloudArea = texture {

    pigment {

      agate

      turbulence 1

      lambda 2

      frequency 2

      color_map {

        [0.0 color rgbf <1, 1, 1, 1>]

        [0.5 color rgbf <1, 1, 1, .35>]

        [1.0 color rgbf <1, 1, 1, 1>]

      }

    }

  }

Now apply all of these to our sphere.

  sphere { <0,0,0>, 1

    texture { LandArea }

    texture { OceanArea }

    texture { CloudArea }

  }

We render this and have a pretty good rendition of a little planetoid. But it could be better. We don't particularly like the appearance of the clouds. There is a way they could be done that would be much more realistic.



Previous:Using Pattern Modifiers   Main Index   Next:Using Pigment Maps