ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmap.h
Revision: 2.7
Committed: Tue May 17 17:39:47 2016 UTC (8 years, 11 months ago) by rschregle
Content type: text/plain
Branch: MAIN
Changes since 2.6: +6 -4 lines
Log Message:
Initial import of ooC photon map

File Contents

# Content
1 /* RCSid $Id: pmap.h,v 2.5 2015/08/18 18:45:55 greg Exp $ */
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 (c) Lucerne University of Applied Sciences and Arts,
10 supported by the Swiss National Science Foundation (SNSF, #147053)
11 ==================================================================
12
13 $Id: pmap.h,v 4.9 2015/08/10 14:05:35 taschreg Exp taschreg $
14 */
15
16
17 #ifndef PMAP_H
18 #define PMAP_H
19
20 #include "pmapparm.h"
21 #include "pmapdata.h"
22
23
24 #ifndef min
25 #define min(a, b) ((a) < (b) ? (a) : (b))
26 #endif
27
28 #ifndef max
29 #define max(a, b) ((a) > (b) ? (a) : (b))
30 #endif
31
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 != NULL)
41 #define directPhotonMapping (directPmap != NULL)
42 #define volumePhotonMapping (volumePmap != NULL)
43 #define contribPhotonMapping (contribPmap && contribPmap -> srcContrib)
44
45
46
47 extern void (*pmapLookup [])(PhotonMap*, RAY*, COLOR);
48 /* Photon map lookup functions per type */
49
50 void loadPmaps (PhotonMap **pmaps, const PhotonMapParams *params);
51 /* Load photon and set their respective parameters, checking timestamps
52 * relative to octree for possible staleness */
53
54 void savePmaps (const PhotonMap **pmaps, int argc, char **argv);
55 /* Save all defined photon maps with specified command line */
56
57 void cleanUpPmaps (PhotonMap **pmaps);
58 /* Trash all photon maps after processing is complete */
59
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
64 void tracePhoton (RAY*);
65 /* Follow photon as it bounces around the scene. Analogon to
66 * raytrace(). */
67
68 void photonDensity (PhotonMap*, RAY*, COLOR irrad);
69 /* Perform surface density estimate from incoming photon flux at
70 ray's intersection point. Returns irradiance from found photons. */
71
72 void photonPreCompDensity (PhotonMap *pmap, RAY *r, COLOR irrad);
73 /* Returns precomputed photon density estimate at ray -> rop. */
74
75 void volumePhotonDensity (PhotonMap*, RAY*, COLOR);
76 /* Perform volume density estimate from incoming photon flux at
77 ray's intersection point. Returns irradiance. */
78
79 void colorNorm (COLOR);
80 /* Normalise colour channels to average of 1 */
81
82 #endif