7.4.2 Photon Global Settings

From [pov:6.10.2.1]:
	global_photon_block:
	photons {
	  spacing <photon_spacing> | count <photons_to_shoot>

	  [gather <min_gather>, <max_gather>]
	  [media <max_steps> [,<factor>]]
	  [jitter <jitter_amount>]
	  [max_trace_level <photon_trace_level>]
	  [adc_bailout <photon_adc_bailout>]
	  [save_file "filename" | load_file "filename"]
	  [autostop <autostop_fraction>]
	  [expand_thresholds <percent_increase>, <expand_min>]
	  [radius <gather_radius>,<multiplier>,
	          <gather_radius_media>,<multiplier>]
	}

	All photons default values:

	Global :
	  expand_min    : 40 
	  gather        : 20, 100
	  jitter        : 0.4
	  media         : 0

	Object :
	  collect       : on
	  refraction    : off
	  reflection    : off
	  split_union   : on
	  target        : 1.0

	Light_source:
	  area_light    : off
	  refraction    : off
	  reflection    : off
The number of photons generated can be set using either the spacing or count keywords:

The keyword gather allows you to specify how many photons are gathered at each point during the regular rendering step. The first number (default 20) is the minimum number to gather, while the second number (default 100) is the maximum number to gather. These are good values and you should only use different ones if you know what you're doing.

The keyword media turns on media photons. The parameter max_steps specifies the maximum number of photons to deposit over an interval. The optional parameter factor specifies the difference in media spacing compared to surface spacing. You can increase factor and decrease max_steps if too many photons are being deposited in media.

The keyword jitter specifies the amount of jitter used in the sampling of light rays in the pre-processing step. The default value is good and usually does not need to be changed.

The keywords max_trace_level and adc_bailout allow you to specify these attributes for the photon-tracing step. If you do not specify these, the values for the primary ray-tracing step will be used.

The keywords save_file and load_file allow you to save and load photon maps. If you load a photon map, no photons will be shot. The photon map file contains all surface (caustic) and media photons.

The keyword radius is used for gathering photons. The larger the radius, the longer it takes to gather photons. But if you use too small of a radius, you might not get enough photons to get a good estimate. Therefore, choosing a good radius is important. Normally POV-Ray looks through the photon map and uses some ad-hoc statistical analysis to determine a reasonable radius. Sometimes it does a good job, sometimes it does not. The radius keyword lets you override or adjust POV-Ray's guess.

The keywords autostop and expand_thresholds will be explained later.
From [pov:6.10.2.2]:
Shooting Photons at an Object

object_photon_block:
photons {
  [target [<spacing_multiplier>]]
  [refraction on|off]
  [reflection on|off]
  [collect on|off]
  [pass_through]
}

To shoot photons at an object, you need to tell Pov-Ray that the object receives photons. To do this, create a photons { } block within the object. For example:

 object {											 
   MyObject
   photons {
     target
     refraction on
     reflection on
     collect off
   }
 }

In this example, the object both reflects and refracts photons. Either of these options could be turned off (by specifying reflection off, for example). By using this, you can have an object with a reflective finish which does not reflect photons for speed and memory reasons.

The keyword target makes this object a target.

The density of the photons can be adjusted by specifying the spacing_multiplier. If, for example, you specify a spacing_multiplier of 0.5, then the spacing for photons hitting this object will be 1/2 of the distance of the spacing for other objects.

Note: This means four times as many surface photons, and eight times as many media photons.

The keyword collect off causes the object to ignore photons. Photons are neither deposited nor gathered on that object.

The keyword pass_through causes photons to pass through the object unaffected on their way to a target object. Once a photon hits the target object, it will ignore the pass_through flag. This is basically a photon version of the no_shadow keyword, with the exception that media within the object will still be affected by the photons (unless that media specifies collect off). If you use the no_shadow keyword, the object will be tagged as pass_through automatically. You can then turn off pass_through if necessary by simply using photons { pass_through off }.

Note: Photons will not be shot at an object unless you specify the target keyword. Simply turning refraction on will not suffice.

When shooting photons at a CSG-union, it may sometimes be of advantage to use split_union off inside the union. POV-Ray will be forced to shoot at the whole object, instead of splitting it up and shooting photons at its compound parts.
From [pov:6.10.2.3]:
Photons and Light Sources

 light_photon_block:
 photons {
   [refraction on | off]
   [reflection on | off]
   [area_light]
 }

Example:

 light_source {
   MyLight
   photons {
     refraction on
     reflection on
   }
 }

Sometimes, you want photons to be shot from one light source and not another. In that case, you can turn photons on for an object, but specify
photons { reflection off refraction off }
in the light source's definition. You can also turn off only reflection or only refraction for any light source.

See also:
$ \cdot$        [pov:6.10.3]Photons FAQ
$ \cdot$        [pov:6.10.4]Photon Tips
$ \cdot$        [pov:6.10.5]Advanced Techniques

Andreas Kriegl 2003-07-23