1 |
.\" RCSid "$Id: mkpmap.1,v 1.8 2018/02/02 19:49:02 rschregle Exp $" |
2 |
.TH MKPMAP 1 "$Date: 2018/02/02 19:49:02 $ $Revision: 1.8 $" RADIANCE |
3 |
|
4 |
.SH NAME |
5 |
mkpmap - generate RADIANCE photon map |
6 |
|
7 |
.SH SYNOPSIS |
8 |
mkpmap \fB\-apg\fR|\fB\-apc\fR|\fB\-apv\fR|\fB\-apd\fR|\fB\-app\fR|\fB\-apC\fR |
9 |
\fIfile nphotons\fR [\fIbwidth\fR] ... |
10 |
[options] \fIoctree\fR |
11 |
|
12 |
.SH DESCRIPTION |
13 |
\fIMkpmap\fR takes a RADIANCE scene description as an octree and |
14 |
performs Monte Carlo forward path tracing from the light sources, |
15 |
depositing indirect ray hitpoints along with their energy (flux) as |
16 |
"photons". The resulting localised energy distribution represents a |
17 |
global illumination solution which is written to a file for subsequent |
18 |
evaluation by \fIrpict(1), rtrace(1)\fR and \fIrvu(1)\fR in a backward |
19 |
raytracing pass. The photon map(s) can be reused for multiple viewpoints |
20 |
and sensor locations as long as the geometry remains unchanged. |
21 |
|
22 |
.SH OPTIONS |
23 |
\fIMkpmap\fR can generate different types of photon maps depending on |
24 |
the materials present in the scene. In most cases, these can be |
25 |
specified independently or in combination on the command line. If |
26 |
multiple photon maps of the same type are specified, the last instance |
27 |
takes precedence. |
28 |
|
29 |
.IP "\fB\-apg \fIfile nphotons\fR" |
30 |
Generate a global photon map containing approximately \fInphotons\fR |
31 |
photons, and output to \fIfile\fR. This accounts for all |
32 |
indirect illumination, from both specular and diffuse scattering, on |
33 |
surfaces with a diffuse component. This is the most general type of |
34 |
photon map and replaces the ambient calculation in \fIrpict(1), |
35 |
rtrace(1)\fR and \fIrvu(1)\fR. |
36 |
|
37 |
.IP "\fB\-apc \fIfile nphotons\fR" |
38 |
Generate a separate caustic photon map containing approximately |
39 |
\fInphotons\fR photons, and output to file \fIfile\fR. This is a |
40 |
subset of the global photon map intended for direct visualisation at |
41 |
primary rays, This accounts for all indirect illumination on diffuse |
42 |
surfaces from specular scattering, which usually exhibits a large |
43 |
gradient and requires a higher resolution than the global photon map, |
44 |
typically containing the tenfold number of photons. |
45 |
|
46 |
.IP "\fB\-apv \fIfile nphotons\fR" |
47 |
Generate a volume photon map containing approximately \fInphotons\fR |
48 |
photons, and output to file \fIfile\fR. These account for indirect |
49 |
inscattering in participating media such as \fBmist\fR and complement |
50 |
the direct inscattering computed by \fIrpict(1), rtrace(1)\fR and |
51 |
\fIrvu(1)\fR. See also the \fB\-me\fR, \fB\-ma\fR and \fB\-mg\fR options |
52 |
below. |
53 |
|
54 |
.IP "\fB\-apd \fIfile nphotons\fR" |
55 |
Generate a direct photon map containing approximately \fInphotons\fR |
56 |
photons, and output to file \fIfile\fR. This only accounts for direct |
57 |
illumination and is intended for debugging and validation of photon emission |
58 |
from the light sources, as the quality is too low for actual rendering. |
59 |
|
60 |
.IP "\fB\-apC \fIfile nphotons\fR" |
61 |
Generate a contribution photon map containing approximately |
62 |
\fInphotons\fR photons, and output to file \fIfile\fR. This may then be |
63 |
used by \fIrcontrib(1)\fR to compute light source contributions. When used |
64 |
with \fIrtrace(1)\fR or \fIrpict(1)\fR, contribution photon maps behave as |
65 |
regular global photon maps and yield cumulative contributions from all light |
66 |
sources. |
67 |
.IP |
68 |
With this option, \fImkpmap\fR uses a modified photon distribution |
69 |
algorithm that ensures all light sources contribute approximately the |
70 |
same number of photons. Each photon indexes a primary hitpoint, incident |
71 |
direction, and emitting light source which can be used to bin |
72 |
contributions per light source and direction. |
73 |
.IP |
74 |
\fIMkpmap\fR cannot generate a contribution photon map in combination with |
75 |
others in a single run, as it uses a different distribution algorithm. Other |
76 |
photon maps specified on the command line will be ignored. |
77 |
|
78 |
.IP "\fB\-app \fIfile nphotons bwidth\fR" |
79 |
Generate a precomputed global photon map containing a fraction of |
80 |
\fInphotons\fR photons (specified with the \fB\-apP\fR option, see |
81 |
below), and output to file \fIfile\fR. This is a special case of the |
82 |
global photon map where the irradiance is evaluated for a fraction of |
83 |
the photon positions using \fIbwidth\fR nearest photons, and stored as |
84 |
photon flux; the remaining photons are discarded as their contributions |
85 |
have been accounted for. |
86 |
.IP |
87 |
This obviates the explicit irradiance evaluation by \fIrpict(1), |
88 |
rtrace(1)\fR and \fIrvu(1)\fR, thus providing a speedup at the expense of |
89 |
accuracy. The resulting error is tolerable if the indirect illumination has |
90 |
a low gradient, as is usually the case with diffuse illumination. |
91 |
|
92 |
.IP "\fB\-apD \fIpredistrib\fR" |
93 |
Photon predistribution factor; this is the fraction of \fInphotons\fR |
94 |
which are emitted in a distribution prepass in order to estimate the |
95 |
remaining number of photons to emit in the main pass to approximately |
96 |
yield a photon map of size \fInphotons\fR. |
97 |
.IP |
98 |
Setting this too high may yield more than \fInphotons\fR in the initial pass |
99 |
with highly reflective geometry. Note that this value may exceed 1, which |
100 |
may be useful if the resulting photon map size greatly deviates from |
101 |
\fInphotons\fR with a very low average reflectance. |
102 |
|
103 |
.IP "\fB\-api \fIxmin ymin zmin xmax ymax zmax\fR" |
104 |
Define a region of interested within which to store photons exclusively; |
105 |
photons will only be stored within the volume bounded by the given minimum |
106 |
and maximum coordinates. Multiple instances of this option may be specified |
107 |
with cumulative effect to define compound regions of interest. This is |
108 |
useful for constraining photons to only the relevant regions of a scene, but |
109 |
may increase the photon distribution time. |
110 |
.IP |
111 |
\fBWARNING: this is an optimisation option for advanced users (an elite |
112 |
group collectively known as \fIZe Ekspertz\fB) and may yield biased results. |
113 |
Use with caution!\fR |
114 |
|
115 |
.IP "\fB\-apm \fImaxbounce\fR" |
116 |
Synonymous with \fB\-lr\fR for backwards compatibility. May be removed in |
117 |
future releases. |
118 |
|
119 |
.IP "\fB\-apM \fImaxprepass\fR" |
120 |
Maximum number of iterations of the distribution prepass before terminating |
121 |
if some photon maps are still empty. This option is rarely needed as a |
122 |
an aborted prepass indicates an anomaly in the geometry or an |
123 |
incompatibility with the specified photon map types (see \fBNOTES\fR below). |
124 |
|
125 |
.IP "\fB\-apo \fImod\fR" |
126 |
Specifies a modifier \fImod\fR to act as a \fIphoton port\fR. All |
127 |
objects using this modifier will emit photons directly in lieu of any |
128 |
light sources defined with the \fIsource\fR material. This greatly |
129 |
accelerates photon distribution in scenes where photons have to enter a |
130 |
space which separates them from the emitting light source via an |
131 |
opening, or port. |
132 |
.IP |
133 |
A typical application is daylight simulation, where a fenestration acts as |
134 |
port to admit photons into an interior after emission from an external light |
135 |
source. Multiple instances of this option may be specified. |
136 |
.IP |
137 |
Note that port objects must be defined with their surface normals |
138 |
pointing \fIinside\fR as per \fImkillum\fR convention. |
139 |
|
140 |
.IP "\fB\-apO \fImodfile\fR" |
141 |
Read photon port modifiers from the file \fImodfile\fR as a more convenient |
142 |
alternative to multiple instances of \fB\-apo\fR. |
143 |
|
144 |
.IP "\fB\-apP \fIprecomp\fR" |
145 |
Fraction of global photons to precompute in the range ]0,1] when using the |
146 |
\fB\-app\fR option. |
147 |
|
148 |
.IP "\fB\-apr \fIseed\fR" |
149 |
Seed for the random number generator. This is useful for generating |
150 |
different photon distributions for the same octree and photon map size, |
151 |
notably in progressive applications. |
152 |
|
153 |
.IP "\fB\-aps \fImod\fR" |
154 |
Specifies a modifier \fImod\fR defined as \fIantimatter\fR material to act |
155 |
as a virtual (i.e. invisible) receiver surface. Photons will be deposited on |
156 |
all surfaces using this modifier, just like regular materials, but will then |
157 |
be transferred through the surface without undergoing scattering; the |
158 |
surface therefore does not affect the light transport and simply acts as an |
159 |
invisible photon receiver. This is useful when photon irradiance is to be |
160 |
evaluated at points which do not lie on regular geometry, e.g. at workplane |
161 |
height with \fIrtrace\fR's \fB-I\fR option. Without this workaround, |
162 |
photons would be collected from parallel but distant planes, leading to |
163 |
underestimation. Note that photons are only deposited when incident from |
164 |
the front side of the sensor surface, i.e. when entering the |
165 |
\fIantimatter\fR, thus the surface normal is relevant. \fIMkpmap\fR reports |
166 |
an error if the specified modifier is not an \fIantimatter\fR material. |
167 |
|
168 |
.IP "\fB\-apS \fImodfile\fR" |
169 |
Read virtual receiver surface modifiers from the file \fImodfile\fR as a more |
170 |
convenient alternative to multiple instances of \fB\-aps\fR. |
171 |
|
172 |
.IP "\fB\-bv\fR[\fB+\fR|\fB-\fR]" |
173 |
Toggles backface visibility; enabling this causes photons to be stored and |
174 |
possibly scattered if they strike the back of a surface, otherwise they |
175 |
are unconditionally absorbed and discarded. |
176 |
|
177 |
.IP "\fB\-dp \fIsampleres\fR" |
178 |
Resolution for sampling the spatial emission distribution of a modified |
179 |
light source (e.g. via \fIbrightfunc\fR), in samples per steradian. This |
180 |
is required for numerically integrating the flux emitted by the light |
181 |
source and for constructing a probability density function for photon |
182 |
emission. The accuracy of photon emission from modified sources |
183 |
therefore depends on this parameter. This parameter may need increasing |
184 |
with complex emission distributions in combination with caustics. |
185 |
|
186 |
.IP "\fB\-ds \fIpartsize\fR" |
187 |
Light source partition size ratio; a light source object is spatially |
188 |
partitioned to distribute the photon emission over its surface. This |
189 |
parameter specifies the ratio of the size (per dimension) of each |
190 |
partition to the scene cube, and may need increasing for modified light |
191 |
sources (e.g. via \fIbrightfunc\fR) with high spatial variation. |
192 |
|
193 |
.IP "\fB\-e \fIfile\fR" |
194 |
Redirect diagnostics and progress reports to \fIfile\fR instead of the |
195 |
console. |
196 |
|
197 |
.IP "\fB\-fo\fR[\fB+\fR|\fB-\fR]" |
198 |
Toggles overwriting of output files. By default, \fImkpmap\fR will not |
199 |
overwrite an already existing photon map file. This is to prevent |
200 |
inadvertently destroying the results of potentially lengthy photon |
201 |
mapping runs. |
202 |
|
203 |
.IP "\fB\-ld \fImaxdist\fR" |
204 |
Limit cumulative distance travelled by a photon along its path to |
205 |
\fImaxdist\fR. Photon hits within this distance will be stored, and the |
206 |
photon is terminated once its path length exceeds this limit. This is |
207 |
useful for setting radial regions of interest around emitting/reflecting |
208 |
geometry, but may increase the photon distribution time. |
209 |
.IP |
210 |
\fBWARNING: this is an optimisation option for advanced users (an elite |
211 |
group collectively known as \fIZe Ekspertz\fB) and may yield biased results. |
212 |
Use with caution!\fR |
213 |
|
214 |
.IP "\fB\-lr \fImaxbounce\fR" |
215 |
Limit number of bounces (scattering events) along a photon path to |
216 |
\fImaxbounce\fR before being considered "runaway" and terminated. Photons |
217 |
paths are normally terminated via \fIRussian Roulette\fR, depending on their |
218 |
albedo. With unrealistically high albedos, this is not guaranteed, and this |
219 |
option imposes a hard limit to avoid an infinite loop. |
220 |
.IP |
221 |
\fBWARNING: this is an optimisation option for advanced users (an elite |
222 |
group collectively known as \fIZe Ekspertz\fB) and may yield biased results. |
223 |
Use with caution!\fR |
224 |
|
225 |
.IP "\fB\-ma \fIralb galb balb\fR" |
226 |
Set the global scattering albedo for participating media in conjunction |
227 |
with the \fB\-apv\fR option. See \fIrpict(1)\fR for details. |
228 |
|
229 |
.IP "\fB\-me \fIrext gext bext\fR" |
230 |
Set the global extinction coefficient for participating media in conjunction |
231 |
with the \fB\-apv\fR option. See \fIrpict(1)\fR for details. |
232 |
|
233 |
.IP "\fB\-mg \fIgecc\fR" |
234 |
Set the global scattering eccentricity for participating media in conjunction |
235 |
with the \fB\-apv\fR option. See \fIrpict(1)\fR for details. |
236 |
|
237 |
.IP "\fB\-n \fInproc\fR" |
238 |
Use \fInproc\fR processes for parallel photon distribution. There is no |
239 |
benefit in specifying more than the number of physical CPU cores available. |
240 |
This option is currently not available on Windows. |
241 |
|
242 |
.IP "\fB\-t \fIinterval\fR" |
243 |
Output a progress report every \fIinterval\fR seconds. This includes |
244 |
statistics about the currently emitting light source (including number of |
245 |
partitions), the total number of photons emitted, the number of each type |
246 |
stored, the percentage of the completed pass (pre or main), and the elapsed |
247 |
time. |
248 |
|
249 |
.SH NOTES |
250 |
|
251 |
.SS Parametrisation |
252 |
\fIMkpmap\fR recognises multiplier suffixes (k = 1000, m = 1000000) to |
253 |
facilitate the specification of \fInphotons\fR, both in upper and lower |
254 |
case. |
255 |
.PP |
256 |
|
257 |
.SS Distribution Algorithm |
258 |
The photon distribution algorithm estimates the number of required |
259 |
photons to emit to arrive at the specified target count \fInphotons\fR |
260 |
per photon map using a distribution prepass followed by a main pass. |
261 |
As a result, \fImkpmap\fR generates the \fBapproximate\fR number of photons |
262 |
specified, which can vary by up to 10% for typical scenes, but can be |
263 |
higher for scenes with unusually high or low reflectance. In this case, |
264 |
the predistribution factor \fB\-apD\fR should be increased for scenes |
265 |
with low reflectance, and reduced for those with high reflectance. |
266 |
.PP |
267 |
There are situations which may prevent certain (or any) |
268 |
photon types from being generated, depending on the light source and material |
269 |
configuration. This typically occurs when attempting to generate a caustic |
270 |
photon map without specular materials present in the scene, or a volume |
271 |
photon map without participating media. Ill-configured light sources may also |
272 |
prevent indirect rays from reaching a surface, and thus no photons being |
273 |
deposited. In these cases, \fImkpmap\fR will make a number of distribution |
274 |
attempts before terminating with an error. This can be adjusted with the |
275 |
\fB\-apM\fR option. |
276 |
|
277 |
.SS Material Support |
278 |
The \fIplasfunc\fR, \fImetfunc\fR, \fItransfunc\fR, \fIbrtdfunc\fR, |
279 |
\fIplasdata\fR, \fImetdata\fR and \fItransdata\fR materials are not |
280 |
supported by the photon mapping extension. Use the newer \fIbsdf\fR material |
281 |
instead. |
282 |
.PP |
283 |
Virtual light sources (normally enabled with the \fImirror\fR material) are |
284 |
disabled with the photon map, as the resulting caustics are already accounted |
285 |
for. |
286 |
|
287 |
.SS Virtual Receiver Surfaces |
288 |
Since photons are surface bound, the density estimate is only asymptotically |
289 |
correct when performed at points which lie on the scene geometry. The |
290 |
irradiance is underestimated for arbitrarily placed points when photons are |
291 |
collected from distant surfaces. \fIMkpmap\fR offers a workaround with a |
292 |
virtual receiver surface using the \fIantimatter\fR material; see the \fB-aps\fR |
293 |
and \fB-apS\fR options for details. |
294 |
|
295 |
.SH EXAMPLES |
296 |
The following command generates a global photon map \fIbonzo.gpm\fR and a |
297 |
caustic photon map \fIbonzo.cpm\fR containing approximately 10000 and 100000 |
298 |
photons, respectively, with progress report every 5 seconds: |
299 |
.IP |
300 |
mkpmap \-apg bonzo.gpm 10k \-apc bonzo.cpm 100k -t 5 bonzo.oct |
301 |
.PP |
302 |
Generate a global photon map containing 80000 photons, then precompute the |
303 |
diffuse irradiance for 1/4 of these with a bandwidth of 40 photons: |
304 |
.IP |
305 |
mkpmap \-app bonzo-precomp.gpm 80k 40 \-apP 0.25 bonzo.oct |
306 |
.PP |
307 |
Generate 1 million global photons by emitting them from external light |
308 |
sources of type \fIsource\fR into a reference room via a fenestration |
309 |
with modifier \fIglazingMat\fR: |
310 |
.IP |
311 |
mkpmap \-apg refRoom.gpm 1m \-apo glazingMat refRoom.oct |
312 |
.PP |
313 |
Generate a contribution photon map containing 200000 photons suitable for |
314 |
obtaining light source contributions with \fIrcontrib(1)\fR: |
315 |
.IP |
316 |
mkpmap \-apC bonzo-contrib.gpm 200k bonzo.oct |
317 |
|
318 |
.SH BUGS |
319 |
The focus of a spotlight source, as defined by the length of its direction |
320 |
vector, is ignored by the photon map; photons are unconditionally emitted |
321 |
from the light source surface, which can lead to deviations from standard |
322 |
RADIANCE. |
323 |
.PP |
324 |
Light sources simply absorb incoming photons. |
325 |
|
326 |
.SH AUTHOR |
327 |
Roland Schregle (roland.schregle@{hslu.ch,gmail.com}) |
328 |
|
329 |
.SH COPYRIGHT |
330 |
(c) Fraunhofer Institute for Solar Energy Systems, Lucerne University of |
331 |
Applied Sciences and Arts. |
332 |
|
333 |
.SH ACKNOWLEDGEMENT |
334 |
Development of the RADIANCE photon mapping extension was sponsored by the |
335 |
German Research Foundation (DFG) and the Swiss National Science Foundation |
336 |
(SNF). |
337 |
|
338 |
.SH "SEE ALSO" |
339 |
rpict(1), rtrace(1), rvu(1), rcontrib(1), \fIThe RADIANCE Photon Map |
340 |
Manual\fR, \fIDevelopment and Integration of the RADIANCE Photon Map |
341 |
Extension: Technical Report\fR |