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

Home
- POV-Ray Tutorial

  Content Overview
  material, interior, media

  - Syntax material
      texture + interior
  - Window Glass
      + max_trace_level
  - Fog, Mist or Haze
  Media
  - 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
                                             

Scaling Object Media

Scaling Object Media
If we increase scale of an object media in POV-Ray scene the media density will not be scaled accordingly!
In consequence more rays will pass through more media than before and this gives accordingly stronger effects.
I.e. a scattering media scatters more intensively and that's why it looks darker (c.f.: the second image on this page!).

How to scale Object Media correctly:
To keep the effect constant we need to reduce the color (i.e. for scattering) by dividing it by the applied scale!

Object media in scale 1.
Object media in scale 4.
Object media in scale 4 with color divided by 4.

Example: How to scale media
#declare Cloud_Scale = 10;// 1, ... 500

#declare Cloud =
sphere{ <0,0,0>, 1
  pigment{rgbt 1}
   hollow
  interior{ //-----------
   media{
    emission <1,1,1>/Cloud_Scale
    scattering{ 1,<1,1,1>/Cloud_Scale}
    density{
     spherical
     turbulence 0
     color_map {
       [0 rgb 0.0]//border
       [1 rgb 1.0]//center
     } // end color_map
    } // end of density
   } // end of media ---
  } // end of interior
scale Cloud_Scale
} //----- end of sphere
//--------------------------------------
object{ Cloud
  // don't do any additional scaling here!
  translate<0,1,15>
} //--------------------------------------
Scene description for POV-Ray:
"media_scaling_10.txt" or
"media_scaling_10.pov"
And as a macro object:
Scene description for POV-Ray:
"media_scaling_macro_10.txt" or
"media_scaling_macro_10.pov"
Object media with Cloud_Scale 1 at <0,1,1>
Object media with Cloud_Scale 10 at <0,1,15>
Object media with Cloud_Scale 500 at <0,50,600>

Example: A cloud with media in a macro
#macro Cloud_01( Cloud_Scale )
sphere{ <0,0,0>, 1
 pigment{rgbt 1}
 hollow
 interior{ //-----------
 media{
  emission <1,1,1>*0.75/Cloud_Scale
  scattering{ 1,<1,1,1>*5/Cloud_Scale}
  samples 20  // increase = more precise
  intervals 1
  density{ spherical
   scale 0.65
   turbulence 1.00
   color_map {
         [0 rgb 0.0] // border
         [1 rgb 1.0] // center
   } // end color_map
  } // end of density
 } // end of media ---
} // end of interior
scale Cloud_Scale
} //----- end of sphere
#end // end of macro ---------------------

object{ Cloud_01( 5 )//Cloud(Cloud_Scale)
 // don't do any additional scaling here!
  rotate <0,0,0>
  translate <0,4,5>
} //--------------------------------------
Object media Cloud_1, scale 5 at <0,4,5>
Scene description for POV-Ray:
"media_macro_Cloud_01.txt" or
"media_macro_Cloud_01.pov"
top
© Friedrich A. Lohmüller, 2014
http://www.f-lohmueller.de