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

Window Glass and max_trace_level

Window glass without IOR: As Glass for windows we should not use "real" glass with definied index of refraction ("ior"). At the refraction in thin layers with parallel surfaces we have only a very small parallel movement of the through falling light which we hardly can notice.
This parallel movement of the through falling light we only can notice at extrem thick pane of glass and only with very flat angles of view - for all "normal" panes of glass the caculation of the "correct" way of the light considering the IOR does not make any visible effect.
This is why for windows we should use a more simpler transparent glass texture without any "interior".

Refraction at thick layers
Refraction at thin layers

Sample for a simple and fast glass texture:
#declare Window_Glass =
  pigment{ rgbf<0.98,0.98,0.98,0.8>}
  finish { diffuse 0.1
           reflection 0.2
           specular 0.8
           roughness 0.0003
           phong 1
           phong_size 400}
  } // end of texture --------------

max_trace_level: The meaning of the keyword "max_trace_level" is easyly to recognize by the following effect: By using transparent textures and materials we sometimes unexpectedly can "look some dark side of things" - some parts of glass surfaces are gone black!
At a surface of glass the raytracer calculates the through passing of 2 interfaces. At 2 panes one behind the other we have already 4 interfaces. If there are located more than 2 panes of glass one behind each other somewhere in our scene, so POV-Ray by default will stop calculating the tracing of the rays after the 5th interface (this means inside the 3rd pane!), because in general the surfaces more behind do not make any relevant contribution to the total brightness.
The according effect will take place by multiple reflection at mirror surfaces.
The threshold of the number if interfaces where the tracing of rays will stop is defined by the keyword "max_trace_level". It's default value is 5, it can be set up to a maximum of 256..
There are many cases where this is not enough, than at these parts we see gray or nearly total black surfaces!

global_settings{ max_trace_level 5 }
global_settings{ max_trace_level 17 }

Remedy against dark spots: To avoid these dark spots we should encrease somewhere at the to of our scene file the max_trace_level by i.e. the following line:

global_settings{ max_trace_level 20 }

Attention: Don't overdo! Don't use unnecessarily high values, because each additional interface have as a consequence an additional calculation of rays for each point, provided that the interfaces before were transparent at least a little bit!
(The right image neads a 4 times longer time for caclculation then the left!)
Test renderings in "QUICK" mode:
If for test rendering we have choosen a resolution like i.e. "320x240, quick, mosaic" glass surfaces are only shown in black or in the defined "quick_color"! Transparency or filter are not calculated in this mode!


© Friedrich A. Lohmüller, 2014