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.5 by rschregle, Tue May 26 13:31:19 2015 UTC vs.
Revision 2.10 by rschregle, Mon Jun 15 22:18:57 2020 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
# Line 33 | 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);
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 55 | Line 60 | int getPmapRenderOpt (int ac, char *av [])
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                 }
# Line 74 | Line 79 | int getPmapRenderOpt (int ac, char *av [])
79                
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");
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
# Line 91 | Line 113 | void printPmapDefaults ()
113   /* Print defaults for photon map render options */
114   {
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