Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
Design of the Interior of transparent Shapes in POV-Ray
Italiano Italiano
Français français
Deutsch Deutsch

- POV-Ray Tutorial

  Content Overview
  material, interior, media

  - Syntax material
      texture + interior
  - Window Glass
      + max_trace_level
  - Fog, Mist or Haze
  - Syntax Media
  - Media+Density Maps
  Atmospheric Media
    with/without density map
  - Beames in the Fog
  Object Media
  Emitting Media
  - Light Sword
  - Candle Flames
  Scattering Media
  - Light through Window
  - Steam, Smoke, Clouds
  Absorbing Media
  - Dust Devils
  Special Problems with Media
  - Scaling of Media
  - Overlapping Media

Beames in the Fog
with Atmospheric Media

Using "media" keyword
for atmospheric effects
outside of objects

lights in low beam and high beam with fog

To simulate fog interacting with lights POV-Ray uses so called volume sampling (calculating and adding together the effect on a limited number of layers of planes beteen the camera and the objects), this works only for a finite ray which hits an object.
Note: POV-Ray cannot sample media along an infinitely long ray. The ray must be finite in order to be possible to sample. This means that sampling media is only possible for rays that hit an object in a finite distance! So no atmospheric media will show up against "background" or "sky_sphere", beause these objects by definition are in an infinite distance.
Using spotlights with media in general is no problem, because also in this case the ray is not infinite (it is sampled only inside the spotlight cone).
It's possible to make lights not interacting with the atmosphere media by adding the keyword "media_interaction off" to the light source statement.
So we can increase the overall light level of a scene for more realism.
For media effects restricted on particular areas, it's better (faster and more accurate) to use "object media" than media patterns.

Spotlight without media fog.
Fog with scattering media:
(scattering = light spreading distributing in all directions)
To produce a global light scattering atmospheric media for fog, we can use "media" without any limitating container:
    1,  // scattering media type 1,2,3,4,5
    0.1 // color of the media (no comma!)
    extinction 0.25//optional 0~1
// = how fast the media absorbs light
This looks pretty rough!
Once again, but more precisely:
    1,  // scattering media type 1,2,3,4,5
    0.1 // color of the media (no comma!)
    extinction 0.25//optional 0~1
            }// end of scattering
  intervals 20 // default 10 //
// = how many samples are tooken into
// consideration.
// The intervals span the entire length
// of the ray from camera to where it
// hits an object
More irregular, more cloudy with density map:
    1,  // scattering media type 1,2,3,4,5
    0.3 // color of the media (no comma!)
    extinction 0.25 //optional 0~1
            }// end of scattering
  intervals 20 //
    density {granite scale 10
      color_map {
        [0.0 rgb <1,1,1>*0.1]
        [0.5 rgb <1,1,1>*0.3]
        [1.0 rgb <1,1,1>*1  ]
        } // end of color_map
      }// end of density
Scene description for POV-Ray:
"atmospheric_media_t3.txt" oder "atmospheric_media_t3.pov"

© Friedrich A. Lohmüller, 2009