ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmap.h
Revision: 2.6
Committed: Tue Sep 1 16:27:52 2015 UTC (8 years, 8 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R0
Changes since 2.5: +1 -2 lines
Log Message:
Removed redundant $Id: in file

File Contents

# User Rev Content
1 greg 2.6 /* RCSid $Id: pmap.h,v 2.5 2015/08/18 18:45:55 greg Exp $ */
2 greg 2.1 /*
3     ==================================================================
4     Photon map main header
5    
6     Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
7     (c) Fraunhofer Institute for Solar Energy Systems,
8 rschregle 2.3 (c) Lucerne University of Applied Sciences and Arts,
9     supported by the Swiss National Science Foundation (SNSF, #147053)
10 greg 2.1 ==================================================================
11    
12     */
13    
14    
15     #ifndef PMAP_H
16     #define PMAP_H
17    
18     #include "pmapparm.h"
19     #include "pmapdata.h"
20    
21    
22 greg 2.2 #ifndef min
23     #define min(a, b) ((a) < (b) ? (a) : (b))
24     #endif
25    
26     #ifndef max
27     #define max(a, b) ((a) > (b) ? (a) : (b))
28     #endif
29    
30 greg 2.1 #define sqr(a) ((a) * (a))
31    
32     /* Average over colour channels */
33     #define colorAvg(col) ((col [0] + col [1] + col [2]) / 3)
34    
35     /* Macros to test for enabled photon maps */
36     #define photonMapping (globalPmap || preCompPmap || \
37 greg 2.4 causticPmap || contribPmap)
38     #define causticPhotonMapping (causticPmap != NULL)
39     #define directPhotonMapping (directPmap != NULL)
40     #define volumePhotonMapping (volumePmap != NULL)
41 greg 2.1 #define contribPhotonMapping (contribPmap && contribPmap -> srcContrib)
42    
43    
44    
45     extern void (*pmapLookup [])(PhotonMap*, RAY*, COLOR);
46     /* Photon map lookup functions per type */
47    
48     void loadPmaps (PhotonMap **pmaps, const PhotonMapParams *params);
49     /* Load photon and set their respective parameters, checking timestamps
50     * relative to octree for possible staleness */
51    
52     void savePmaps (const PhotonMap **pmaps, int argc, char **argv);
53     /* Save all defined photon maps with specified command line */
54    
55     void cleanUpPmaps (PhotonMap **pmaps);
56     /* Trash all photon maps after processing is complete */
57    
58     void distribPhotons (PhotonMap **pmaps);
59     /* Emit photons from light sources and build photon maps for non-NULL
60     * entries in photon map array */
61    
62     void tracePhoton (RAY*);
63     /* Follow photon as it bounces around the scene. Analogon to
64     * raytrace(). */
65    
66     void photonDensity (PhotonMap*, RAY*, COLOR irrad);
67     /* Perform surface density estimate from incoming photon flux at
68     ray's intersection point. Returns irradiance from found photons. */
69    
70     void photonPreCompDensity (PhotonMap *pmap, RAY *r, COLOR irrad);
71     /* Returns precomputed photon density estimate at ray -> rop. */
72    
73     void volumePhotonDensity (PhotonMap*, RAY*, COLOR);
74     /* Perform volume density estimate from incoming photon flux at
75     ray's intersection point. Returns irradiance. */
76    
77     void colorNorm (COLOR);
78     /* Normalise colour channels to average of 1 */
79    
80     #endif