ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmapopt.c
(Generate patch)

Comparing ray/src/rt/pmapopt.c (file contents):
Revision 2.1 by greg, Tue Feb 24 19:39:27 2015 UTC vs.
Revision 2.8 by rschregle, Tue May 17 17:39:47 2016 UTC

# Line 1 | Line 1
1 + #ifndef lint
2 + static const char RCSid[] = "$Id$";
3 + #endif
4 +
5   /*
6     ==================================================================
7     Photon map interface to RADIANCE render options
8  
9     Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
10     (c) Fraunhofer Institute for Solar Energy Systems,
11 <       Lucerne University of Applied Sciences & Arts
11 >   (c) Lucerne University of Applied Sciences and Arts,
12 >   supported by the Swiss National Science Foundation (SNSF, #147053)
13     ==================================================================  
14    
15     $Id$
# Line 12 | Line 17
17  
18  
19  
20 < #include <stdlib.h>
20 > #include "ray.h"
21   #include "pmapparm.h"
17 #include "rtio.h"
18 #include "rterror.h"
22  
23  
24  
# Line 34 | Line 37 | int getPmapRenderOpt (int ac, char *av [])
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);
42 +              
43                 if (!check(3, "s")) {
44                    /* File -> assume bwidth = 1 or precomputed pmap */
45                    if (++t >= NUM_PMAP_TYPES)
# Line 71 | Line 77 | int getPmapRenderOpt (int ac, char *av [])
77                 }
78                 else return 2;
79                
80 <            case 'm': /* max photon search radius coefficient */
81 <               if (check(3, "f") || (maxDistCoeff = atof(av [1])) <= 0)
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 coefficient");
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
# Line 89 | Line 112 | int getPmapRenderOpt (int ac, char *av [])
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines