Radiosity-Pretrace 1.0 User Manual

This document explains how to use the POV-Ray SDL file radiosity-pretrace.inc, which implements some of the radiosity pretrace recomendations in Radiosity Voodoo Volume 2 in povray.text.tutorials. The main reason for creating the file was to automatically generate an ideal pretrace_start value by calculating the power of 2 by which to multiply the pretrace_end without exceeding a given maximum.

Downloaded Files

The zip archive should contain these three files:

File radiosity-pretrace.inc is the only file required; the other two are part of the documentation.

Prerequisite

Requires POV-Ray version 3.5 or later.

Finish ambients will work as expected for versions 3.5, 3.6, and 3.7.

Usage

  1. Include this file once prior to using the macro:

    #include "radiosity-pretrace.inc"

    Including the file more than once is harmless, though unnecessary.

  2. To write the radiosity settings to the debug stream, set identifier Radiosity_Pretrace_debug to true before the next step:

    #declare Radiosity_Pretrace_debug = true;
  3. Call Radiosity_Pretrace() from within the radiosity block. For example:

    global_settings
    { radiosity
      { count 200
        error_bound 0.5
        Radiosity_Pretrace (0.1, 1)
        recursion_limit 2
      }
    }

Macro

Radiosity_Pretrace (Max, Min)

Macro CallwoodIkebanaCSG() creates the object, untextured (except as described in the next section). The arguments are:

Max:
The maximum value for pretrace_start. The actual value used may be less than this, but will always be more than half this value.
Min:
If less than 1.0, this will be used directly as the pretrace_end. If 1.0 or greater, this will be the pretrace_end value in pixels.

For the Radiosity Voodoo recommendation, pass 1 as the Min argument. However, I find that 2 is usually sufficient. If you are still using POV-Ray 3.6, a value of 0.01 is often sufficient.

Examples

Example 1

radiosity
{ Radiosity_Pretrace (0.1, 2)
}
If this is rendered as 800 by 600 pixels, Min argument 2 translates to a pretrace_end of 2/800. The largest power of 2 that will not cause pretrace_start to exceed Max argument 0.1 is 5, and (2/800) × 2⁵ = 0.08. The resulting radiosity block is:
radiosity
{ pretrace_start 0.08
  pretrace_end 0.0025
}

Example 2

radiosity
{ Radiosity_Pretrace (0.08, 0.01)
}
Since the Min argument is less than 1.0, it will be used directly as the pretrace_end. The largest power of 2 that will not cause pretrace_start to exceed Max argument 0.08 is 3, and 0.01 × 2³ = 0.08. The resulting radiosity block is:
radiosity
{ pretrace_start 0.08
  pretrace_end 0.01
}

About Radiosity-Pretrace

Copyright © 2014 Richard Callwood III. Some rights reserved.
This work is licensed under the GNU General Public License 3.0.

Change Log

Version Date Notes
1.0 January 16, 2014 Initial release.