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.
The zip archive should contain these three files:
radiosity-pretrace.css
radiosity-pretrace.html
radiosity-pretrace.inc
File radiosity-pretrace.inc is the only file required; the other two are part of the documentation.
Requires POV-Ray version 3.5 or later.
Finish ambients will work as expected for versions 3.5, 3.6, and 3.7.
Include this file once prior to using the macro:
#include "radiosity-pretrace.inc"
Including the file more than once is harmless, though unnecessary.
(Optional.) 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;
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
}
}
Sets pretrace_start and pretrace_end. The arguments are:
Max:
pretrace_start. The actual value used may be less than this, but will always be more than half this value.
Min:
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.
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
}
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
}
| Version | Date | Notes |
|---|---|---|
| 1.0 | January 16, 2014 | Initial release. |
| 1.0a | January 17, 2014 | A correction is made to the user manual. |