1 |
+ |
/* RCSid $Id$ */ |
2 |
+ |
|
3 |
|
/* |
4 |
|
================================================================== |
5 |
|
Photon map main header |
6 |
|
|
7 |
|
Roland Schregle (roland.schregle@{hslu.ch, gmail.com}) |
8 |
|
(c) Fraunhofer Institute for Solar Energy Systems, |
9 |
< |
Lucerne University of Applied Sciences & Arts |
9 |
> |
(c) Lucerne University of Applied Sciences and Arts, |
10 |
> |
supported by the Swiss National Science Foundation (SNSF, #147053) |
11 |
|
================================================================== |
12 |
|
|
13 |
|
$Id$ |
22 |
|
|
23 |
|
|
24 |
|
#ifndef min |
25 |
< |
#define min(a, b) ((a) < (b) ? (a) : (b)) |
25 |
> |
#define min(a, b) ((a) < (b) ? (a) : (b)) |
26 |
|
#endif |
27 |
|
|
28 |
|
#ifndef max |
29 |
< |
#define max(a, b) ((a) > (b) ? (a) : (b)) |
29 |
> |
#define max(a, b) ((a) > (b) ? (a) : (b)) |
30 |
|
#endif |
31 |
|
|
32 |
< |
#define sqr(a) ((a) * (a)) |
32 |
> |
#define sqr(a) ((a) * (a)) |
33 |
|
|
34 |
|
/* Average over colour channels */ |
35 |
|
#define colorAvg(col) ((col [0] + col [1] + col [2]) / 3) |
36 |
|
|
37 |
|
/* Macros to test for enabled photon maps */ |
38 |
|
#define photonMapping (globalPmap || preCompPmap || \ |
39 |
< |
causticPmap ||contribPmap) |
40 |
< |
#define causticPhotonMapping (causticPmap) |
41 |
< |
#define directPhotonMapping (directPmap) |
42 |
< |
#define volumePhotonMapping (volumePmap) |
39 |
> |
causticPmap || contribPmap) |
40 |
> |
#define causticPhotonMapping (causticPmap != NULL) |
41 |
> |
#define directPhotonMapping (directPmap != NULL) |
42 |
> |
#define volumePhotonMapping (volumePmap != NULL) |
43 |
|
#define contribPhotonMapping (contribPmap && contribPmap -> srcContrib) |
44 |
|
|
45 |
|
|
57 |
|
void cleanUpPmaps (PhotonMap **pmaps); |
58 |
|
/* Trash all photon maps after processing is complete */ |
59 |
|
|
60 |
< |
void distribPhotons (PhotonMap **pmaps); |
60 |
> |
void distribPhotons (PhotonMap **pmaps, unsigned numProc); |
61 |
|
/* Emit photons from light sources and build photon maps for non-NULL |
62 |
|
* entries in photon map array */ |
63 |
|
|