| 1 |
+ |
#ifndef lint |
| 2 |
+ |
static const char RCSid[] = "$Id$"; |
| 3 |
+ |
#endif |
| 4 |
+ |
|
| 5 |
|
/* |
| 6 |
|
================================================================== |
| 7 |
|
Photon map interface to RADIANCE render options |
| 37 |
|
case 'a': |
| 38 |
|
switch (av [0][2]) { |
| 39 |
|
case 'p': /* photon map */ |
| 40 |
< |
/* Asking for photon map, ergo ambounce != 0 */ |
| 41 |
< |
ambounce += (ambounce == 0); |
| 40 |
> |
/* Asking for photon map, ergo ambounce != 0 */ |
| 41 |
> |
ambounce += (ambounce == 0); |
| 42 |
> |
|
| 43 |
|
if (!check(3, "s")) { |
| 44 |
|
/* File -> assume bwidth = 1 or precomputed pmap */ |
| 45 |
|
if (++t >= NUM_PMAP_TYPES) |
| 60 |
|
return -1; |
| 61 |
|
} |
| 62 |
|
else { |
| 63 |
< |
sprintf(errmsg, "no photon lookup bandwidth specified, " |
| 64 |
< |
"using default %d", defaultGather); |
| 63 |
> |
sprintf(errmsg, "missing photon lookup bandwidth, " |
| 64 |
> |
"defaulting to %d", defaultGather); |
| 65 |
|
error(WARNING, errmsg); |
| 66 |
|
return 1; |
| 67 |
|
} |
| 77 |
|
} |
| 78 |
|
else return 2; |
| 79 |
|
|
| 80 |
< |
case 'm': /* max photon search radius coefficient */ |
| 81 |
< |
if (check(3, "f") || (maxDistCoeff = atof(av [1])) <= 0) |
| 82 |
< |
error(USER, "invalid max photon search radius coefficient"); |
| 80 |
> |
case 'm': /* Fixed max photon search radius */ |
| 81 |
> |
if (check(3, "f") || (maxDistFix = atof(av [1])) <= 0) |
| 82 |
> |
error(USER, "invalid max photon search radius"); |
| 83 |
|
|
| 84 |
|
return 1; |
| 85 |
+ |
|
| 86 |
+ |
#ifdef PMAP_OOC |
| 87 |
+ |
case 'c': /* OOC pmap cache page size ratio */ |
| 88 |
+ |
if (check(3, "f") || (pmapCachePageSize = atof(av [1])) <= 0) |
| 89 |
+ |
error(USER, "invalid photon cache page size ratio"); |
| 90 |
+ |
|
| 91 |
+ |
return 1; |
| 92 |
+ |
|
| 93 |
+ |
case 'C': /* OOC pmap cache size (in photons); 0 = no caching */ |
| 94 |
+ |
if (check(3, "s")) |
| 95 |
+ |
error(USER, "invalid number of cached photons"); |
| 96 |
+ |
|
| 97 |
+ |
/* Parsing failure sets to zero and disables caching */ |
| 98 |
+ |
pmapCacheSize = parseMultiplier(av [1]); |
| 99 |
+ |
|
| 100 |
+ |
return 1; |
| 101 |
+ |
#endif |
| 102 |
|
} |
| 103 |
|
} |
| 104 |
|
#undef check |
| 112 |
|
void printPmapDefaults () |
| 113 |
|
/* Print defaults for photon map render options */ |
| 114 |
|
{ |
| 115 |
< |
puts("-ap file [bwidth1 [bwidth2]]\t# photon map"); |
| 116 |
< |
printf("-am %.1f\t\t\t# max photon search radius coeff\n", maxDistCoeff); |
| 115 |
> |
printf("-am %.1f\t\t\t\t# max photon search radius\n", maxDistFix); |
| 116 |
> |
#ifdef PMAP_OOC |
| 117 |
> |
printf("-ac %.1f\t\t\t\t# photon cache page size ratio\n", |
| 118 |
> |
pmapCachePageSize); |
| 119 |
> |
printf("-aC %ld\t\t\t# num cached photons\n", pmapCacheSize); |
| 120 |
> |
#endif |
| 121 |
|
} |