ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmap.h
Revision: 2.9
Committed: Wed Jan 24 19:39:05 2018 UTC (6 years, 3 months ago) by rschregle
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad5R3, HEAD
Changes since 2.8: +6 -5 lines
Log Message:
Hack to render contrib pmap as regular global pmap with rpict/rtrace/rvu

File Contents

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