POV-Ray : Documentation : 1.3.6.4 Multiple medias inside the same object
  POV-Ray 3.6 Documentation Online View  
1.3.6.3 Simple media examples   1.3.6.5 Media and transformations

1.3.6.4 Multiple medias inside the same object

Emitting media works well with dark backgrounds. Absorbing media works well for light backgrounds. But what if we want a media which works with both type of backgrounds?

One solution for this is to use both types of medias inside the same object. This is possible in POV-Ray.

Let's take the very first example, which did not work well with the white background, and add a slightly absorbing media to the sphere:

 sphere
 { 0,1 pigment { rgbt 1 } hollow
   interior
   { media
     { emission 1
       density
       { spherical density_map
         { [0 rgb 0]
           [0.4 rgb <1,0,0>]
           [0.8 rgb <1,1,0>]
           [1 rgb 1]
         }
       }
     }
     media
     { absorption 0.2
     }
   }
 }

This will make the sphere not only add light to the rays passing through it, but also substract.

Emitting and absorbing media example

Multiple medias in the same object can be used for several other effects as well.

1.3.6.3 Simple media examples   1.3.6.5 Media and transformations


Copyright 2003-2004 Persistence of Vision Raytracer Pty. Ltd.