1 |
+ |
/* RCSid $Id$ */ |
2 |
+ |
|
3 |
|
/* |
4 |
< |
================================================================== |
5 |
< |
Parameters for photon map generation; used by MKPMAP |
6 |
< |
For inclusion in mkpmap.c |
4 |
> |
====================================================================== |
5 |
> |
Parameters for photon map generation and rendering; used by mkpmap |
6 |
> |
and rpict/rvu/rtrace. |
7 |
|
|
8 |
|
Roland Schregle (roland.schregle@{hslu.ch, gmail.com} |
9 |
|
(c) Fraunhofer Institute for Solar Energy Systems, |
10 |
+ |
supported by the German Research Foundation |
11 |
+ |
(DFG LU-204/10-2, "Fassadenintegrierte Regelsysteme" (FARESYS)) |
12 |
|
(c) Lucerne University of Applied Sciences and Arts, |
13 |
< |
supported by the Swiss National Science Foundation (SNSF, #147053) |
14 |
< |
================================================================== |
13 |
> |
supported by the Swiss National Science Foundation |
14 |
> |
(SNSF #147053, "Daylight Redirecting Components") |
15 |
> |
====================================================================== |
16 |
|
|
17 |
|
$Id$ |
18 |
|
*/ |
23 |
|
|
24 |
|
#include "pmaptype.h" |
25 |
|
|
26 |
< |
|
26 |
> |
#ifdef __cplusplus |
27 |
> |
extern "C" { |
28 |
> |
#endif |
29 |
> |
|
30 |
|
/* Struct for passing params per photon map from rpict/rtrace/rvu */ |
31 |
|
typedef struct { |
32 |
|
char *fileName; /* Photon map file */ |
33 |
|
unsigned minGather, maxGather; /* Num photons to gather */ |
34 |
|
unsigned long distribTarget; /* Num photons to store */ |
35 |
|
} PhotonMapParams; |
36 |
+ |
|
37 |
+ |
/* Region of interest */ |
38 |
+ |
typedef struct { |
39 |
+ |
/* siz [1], siz [2] <= 0 --> sphere, else rectangle */ |
40 |
+ |
float pos [3], siz [3]; |
41 |
+ |
} PhotonMapROI; |
42 |
+ |
|
43 |
+ |
#define PMAP_ROI_ISSPHERE(roi) ((roi)->siz[1] <= 0 && (roi)->siz[2] <= 0) |
44 |
+ |
#define PMAP_ROI_SETSPHERE(roi) ((roi)->siz[1] = (roi)->siz[2] = -1) |
45 |
|
|
46 |
|
|
47 |
|
extern PhotonMapParams pmapParams [NUM_PMAP_TYPES]; |
55 |
|
#define contribPmapParams (pmapParams [PMAP_TYPE_CONTRIB]) |
56 |
|
|
57 |
|
|
58 |
< |
extern float pdfSamples, preDistrib, finalGather, gatherTolerance, |
59 |
< |
maxDistCoeff; |
60 |
< |
extern unsigned long photonHeapSizeInc, photonMaxBounce; |
61 |
< |
extern unsigned photonRepTime, maxPreDistrib, defaultGather; |
62 |
< |
#ifdef PMAP_ROI |
63 |
< |
extern float pmapROI [6]; |
58 |
> |
extern float pdfSamples, preDistrib, finalGather, |
59 |
> |
gatherTolerance, maxDistFix, pmapMaxDist, |
60 |
> |
photonMaxDist; |
61 |
> |
extern unsigned long photonHeapSizeInc, photonMaxBounce; |
62 |
> |
extern unsigned photonRepTime, maxPreDistrib, defaultGather, |
63 |
> |
verbose; |
64 |
> |
|
65 |
> |
extern unsigned pmapNumROI; |
66 |
> |
extern PhotonMapROI *pmapROI; |
67 |
> |
|
68 |
> |
#ifdef PMAP_OOC |
69 |
> |
extern float pmapCachePageSize; |
70 |
> |
extern unsigned long pmapCacheSize; |
71 |
|
#endif |
72 |
|
|
73 |
+ |
|
74 |
|
struct PhotonMap; |
75 |
|
|
76 |
|
int setPmapParam (struct PhotonMap **pm, const PhotonMapParams *parm); |
79 |
|
unsigned long parseMultiplier (const char *num); |
80 |
|
/* Evaluate numeric parameter string with optional multiplier suffix |
81 |
|
(G = 10^9, M = 10^6, K = 10^3). Returns 0 if parsing fails. */ |
82 |
+ |
|
83 |
+ |
#ifdef __cplusplus |
84 |
+ |
} |
85 |
+ |
#endif |
86 |
+ |
|
87 |
|
#endif |