30 |
|
#include <sys/stat.h> |
31 |
|
|
32 |
|
|
33 |
+ |
/* Enable options for Ze Ekspertz only! */ |
34 |
+ |
#define PMAP_EKSPERTZ |
35 |
+ |
|
36 |
+ |
|
37 |
|
extern char VersionID []; |
38 |
|
|
39 |
|
|
75 |
|
void printdefaults() |
76 |
|
/* print default values to stdout */ |
77 |
|
{ |
74 |
– |
puts("-apg file nPhotons\t\t# global photon map"); |
75 |
– |
puts("-apc file nPhotons\t\t# caustic photon map"); |
76 |
– |
puts("-apd file nPhotons\t\t# direct photon map"); |
77 |
– |
puts("-app file nPhotons bwidth\t# precomputed global photon map"); |
78 |
– |
puts("-apv file nPhotons\t\t# volume photon map"); |
79 |
– |
puts("-apC file nPhotons\t\t# contribution photon map"); |
80 |
– |
|
81 |
– |
printf("-apD %f\t\t\t# predistribution factor\n", preDistrib); |
82 |
– |
printf("-apM %d\t\t\t\t# max predistrib passes\n", maxPreDistrib); |
83 |
– |
printf("-apm %ld\t\t\t# max photon bounces\n", photonMaxBounce); |
84 |
– |
puts("-apo mod\t\t\t# photon port modifier"); |
85 |
– |
puts("-apO file\t\t\t# photon port file"); |
86 |
– |
printf("-apP %f\t\t\t# precomputation factor\n", finalGather); |
87 |
– |
printf("-apr %d\t\t\t\t# random seed\n", randSeed); |
88 |
– |
puts("-aps mod\t\t\t# antimatter sensor modifier"); |
89 |
– |
puts("-apS file\t\t\t# antimatter sensor file"); |
78 |
|
|
79 |
< |
printf(backvis ? "-bv+\t\t\t\t# back face visibility on\n" |
80 |
< |
: "-bv-\t\t\t\t# back face visibility off\n"); |
81 |
< |
printf("-dp %.1f\t\t\t# PDF samples / sr\n", pdfSamples); |
82 |
< |
printf("-ds %f\t\t\t# source partition size ratio\n", srcsizerat); |
83 |
< |
printf("-e %s\t\t\t# diagnostics output file\n", diagFile); |
84 |
< |
printf(clobber ? "-fo+\t\t\t\t# force overwrite\n" |
85 |
< |
: "-fo-\t\t\t\t# do not overwrite\n"); |
86 |
< |
printf("-ma %.2f %.2f %.2f\t\t# scattering albedo\n", |
79 |
> |
#ifdef EVALDRC_HACK |
80 |
> |
/* EvalDRC support */ |
81 |
> |
puts("-A\t\t\t\t# angular source file"); |
82 |
> |
#endif |
83 |
> |
#ifdef PMAP_EKSPERTZ |
84 |
> |
puts("-api xmin ymin zmin xmax ymax zmax\t# region of interest"); |
85 |
> |
#endif |
86 |
> |
puts("-apg file nPhotons\t\t\t# global photon map"); |
87 |
> |
puts("-apc file nPhotons\t\t\t# caustic photon map"); |
88 |
> |
puts("-apd file nPhotons\t\t\t# direct photon map"); |
89 |
> |
puts("-app file nPhotons bwidth\t\t# precomputed global photon map"); |
90 |
> |
puts("-apv file nPhotons\t\t\t# volume photon map"); |
91 |
> |
puts("-apC file nPhotons\t\t\t# contribution photon map"); |
92 |
> |
printf("-apD %f\t\t\t\t# predistribution factor\n", preDistrib); |
93 |
> |
printf("-apM %d\t\t\t\t\t# max predistrib passes\n", maxPreDistrib); |
94 |
> |
#if 1 |
95 |
> |
/* Kept for backwards compat, will be gradually phased out by -lD, -lr */ |
96 |
> |
printf("-apm %ld\t\t\t\t# limit photon bounces\n", photonMaxBounce); |
97 |
> |
#endif |
98 |
> |
puts("-apo mod\t\t\t\t# photon port modifier"); |
99 |
> |
puts("-apO file\t\t\t\t# photon port file"); |
100 |
> |
printf("-apP %f\t\t\t\t# precomputation factor\n", finalGather); |
101 |
> |
printf("-apr %d\t\t\t\t\t# random seed\n", randSeed); |
102 |
> |
puts("-aps mod\t\t\t\t# antimatter sensor modifier"); |
103 |
> |
puts("-apS file\t\t\t\t# antimatter sensor file"); |
104 |
> |
|
105 |
> |
printf(backvis ? "-bv+\t\t\t\t\t# back face visibility on\n" |
106 |
> |
: "-bv-\t\t\t\t\t# back face visibility off\n"); |
107 |
> |
printf("-dp %.1f\t\t\t\t# PDF samples / sr\n", pdfSamples); |
108 |
> |
printf("-ds %f\t\t\t\t# source partition size ratio\n", srcsizerat); |
109 |
> |
printf("-e %s\t\t\t\t# diagnostics output file\n", diagFile); |
110 |
> |
printf(clobber ? "-fo+\t\t\t\t\t# force overwrite\n" |
111 |
> |
: "-fo-\t\t\t\t\t# do not overwrite\n"); |
112 |
> |
#ifdef PMAP_EKSPERTZ |
113 |
> |
/* NU STUFF for Ze Exspertz! */ |
114 |
> |
printf("-ld %.1f\t\t\t\t\t# limit photon distance\n", photonMaxDist); |
115 |
> |
printf("-lr %ld\t\t\t\t# limit photon bounces\n", photonMaxBounce); |
116 |
> |
#endif |
117 |
> |
printf("-ma %.2f %.2f %.2f\t\t\t# scattering albedo\n", |
118 |
|
colval(salbedo,RED), colval(salbedo,GRN), colval(salbedo,BLU)); |
119 |
< |
printf("-me %.2e %.2e %.2e\t# extinction coefficient\n", |
119 |
> |
printf("-me %.2e %.2e %.2e\t\t# extinction coefficient\n", |
120 |
|
colval(cextinction,RED), colval(cextinction,GRN), |
121 |
|
colval(cextinction,BLU)); |
122 |
< |
printf("-mg %.2f\t\t\t# scattering eccentricity\n", seccg); |
122 |
> |
printf("-mg %.2f\t\t\t\t# scattering eccentricity\n", seccg); |
123 |
|
#if NIX |
124 |
|
/* Multiprocessing on NIX only */ |
125 |
< |
printf("-n %d\t\t\t\t# number of parallel processes\n", nproc); |
125 |
> |
printf("-n %d\t\t\t\t\t# number of parallel processes\n", nproc); |
126 |
|
#endif |
127 |
< |
printf("-t %-9d\t\t\t# time between reports\n", photonRepTime); |
128 |
< |
printf(verbose ? "-v+\t\t\t\t# verbose console output\n" |
129 |
< |
: "-v-\t\t\t\t# terse console output\n"); |
111 |
< |
#ifdef PMAP_ROI |
112 |
< |
/* Ziss option for ze egg-spurtz only! */ |
113 |
< |
puts("-api xmin ymin zmin\n xmax ymax zmax\t\t# region of interest"); |
114 |
< |
#endif |
115 |
< |
#ifdef EVALDRC_HACK |
116 |
< |
/* ... and ziss one... */ |
117 |
< |
puts("-A\t\t\t\t# angular source file"); |
118 |
< |
#endif |
127 |
> |
printf("-t %-9d\t\t\t\t# time between reports\n", photonRepTime); |
128 |
> |
printf(verbose ? "-v+\t\t\t\t\t# verbose console output\n" |
129 |
> |
: "-v-\t\t\t\t\t# terse console output\n"); |
130 |
|
} |
131 |
|
|
132 |
|
|
193 |
|
if (!globalPmapParams.distribTarget) |
194 |
|
goto badopt; |
195 |
|
globalPmapParams.minGather = globalPmapParams.maxGather = 0; |
196 |
< |
} |
186 |
< |
|
187 |
< |
else if (!strcmp(argv [i] + 2, "pm")) { |
188 |
< |
/* Max photon bounces */ |
189 |
< |
check(4, "i"); |
190 |
< |
photonMaxBounce = atol(argv [++i]); |
191 |
< |
if (photonMaxBounce <= 0) |
192 |
< |
error(USER, "max photon bounces must be > 0"); |
193 |
< |
} |
196 |
> |
} |
197 |
|
|
198 |
|
else if (!strcmp(argv [i] + 2, "pp")) { |
199 |
|
/* Precomputed global photon map */ |
248 |
|
if (!contribPmapParams.distribTarget) |
249 |
|
goto badopt; |
250 |
|
} |
251 |
< |
|
251 |
> |
|
252 |
|
else if (!strcmp(argv [i] + 2, "pD")) { |
253 |
|
/* Predistribution factor */ |
254 |
|
check(4, "f"); |
256 |
|
if (preDistrib <= 0) |
257 |
|
error(USER, "predistribution factor must be > 0"); |
258 |
|
} |
259 |
< |
|
259 |
> |
|
260 |
|
else if (!strcmp(argv [i] + 2, "pM")) { |
261 |
|
/* Max predistribution passes */ |
262 |
|
check(4, "i"); |
264 |
|
if (maxPreDistrib <= 0) |
265 |
|
error(USER, "max predistribution passes must be > 0"); |
266 |
|
} |
267 |
< |
|
268 |
< |
#ifdef PMAP_ROI |
269 |
< |
/* Add region of interest; for ze egg-spurtz only! */ |
267 |
> |
#if 1 |
268 |
> |
/* Kept for backwards compat, to be phased out by -lr */ |
269 |
> |
else if (!strcmp(argv [i] + 2, "pm")) { |
270 |
> |
/* Max photon bounces */ |
271 |
> |
check(4, "i"); |
272 |
> |
photonMaxBounce = atol(argv [++i]); |
273 |
> |
if (photonMaxBounce <= 0) |
274 |
> |
error(USER, "max photon bounces must be > 0"); |
275 |
> |
} |
276 |
> |
#endif |
277 |
> |
#ifdef PMAP_EKSPERTZ |
278 |
> |
/* Add region of interest; for Ze Ekspertz only! */ |
279 |
|
else if (!strcmp(argv [i] + 2, "pi")) { |
280 |
|
unsigned j, n = pmapNumROI; |
281 |
|
check(4, "ffffff"); |
297 |
|
error(USER, |
298 |
|
"invalid region of interest (swapped min/max?)"); |
299 |
|
} |
300 |
< |
#endif |
289 |
< |
|
300 |
> |
#endif |
301 |
|
else if (!strcmp(argv [i] + 2, "pP")) { |
302 |
|
/* Global photon precomputation factor */ |
303 |
|
check(4, "f"); |
411 |
|
|
412 |
|
else goto badopt; |
413 |
|
break; |
414 |
< |
|
414 |
> |
#ifdef PMAP_EKSPERTZ |
415 |
> |
case 'l': /* Limits */ |
416 |
> |
switch (argv [i][2]) { |
417 |
> |
case 'd': /* Limit photon path distance */ |
418 |
> |
check(3, "f"); |
419 |
> |
photonMaxDist = atof(argv [++i]); |
420 |
> |
if (photonMaxDist <= 0) |
421 |
> |
error(USER, "max photon distance must be > 0"); |
422 |
> |
break; |
423 |
> |
|
424 |
> |
case 'r': /* Limit photon bounces */ |
425 |
> |
check(3, "i"); |
426 |
> |
photonMaxBounce = atol(argv [++i]); |
427 |
> |
if (photonMaxBounce <= 0) |
428 |
> |
error(USER, "max photon bounces must be > 0"); |
429 |
> |
break; |
430 |
> |
|
431 |
> |
default: goto badopt; |
432 |
> |
} |
433 |
> |
break; |
434 |
> |
#endif |
435 |
|
case 'm': /* Medium */ |
436 |
|
switch (argv[i][2]) { |
437 |
|
case 'e': /* Eggs-tinction coefficient */ |