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

Comparing ray/src/rt/renderopts.c (file contents):
Revision 2.7 by greg, Fri Aug 20 20:03:00 2004 UTC vs.
Revision 2.18 by greg, Mon Mar 21 19:06:08 2016 UTC

# Line 11 | Line 11 | static const char      RCSid[] = "$Id$";
11  
12   #include  "ray.h"
13   #include  "paths.h"
14 + #include  "pmapopt.h"
15  
16  
17 < extern int
17 > int
18   getrenderopt(           /* get next render option */
19          int  ac,
20          char  *av[]
# Line 22 | Line 23 | getrenderopt(          /* get next render option */
23   #define  check(ol,al)           if (av[0][ol] || \
24                                  badarg(ac-1,av+1,al)) \
25                                  return(-1)
26 < #define  bool(olen,var)         switch (av[0][olen]) { \
26 > #define  check_bool(olen,var)           switch (av[0][olen]) { \
27                                  case '\0': var = !var; break; \
28                                  case 'y': case 'Y': case 't': case 'T': \
29                                  case '+': case '1': var = 1; break; \
# Line 36 | Line 37 | getrenderopt(          /* get next render option */
37                  return(-1);
38                                          /* check if it's one we know */
39          switch (av[0][1]) {
40 +        case 'u':                               /* uncorrelated sampling */
41 +                check_bool(2,rand_samp);
42 +                return(0);
43          case 'b':                               /* back face vis. */
44                  if (av[0][2] == 'v') {
45 <                        bool(3,backvis);
45 >                        check_bool(3,backvis);
46                          return(0);
47                  }
48                  break;
# Line 65 | Line 69 | getrenderopt(          /* get next render option */
69                          vspretest = atoi(av[1]);
70                          return(1);
71                  case 'v':                               /* visibility */
72 <                        bool(3,directvis);
72 >                        check_bool(3,directvis);
73                          return(0);
74                  case 's':                               /* size */
75                          check(3,"f");
# Line 79 | Line 83 | getrenderopt(          /* get next render option */
83                          check(3,"f");
84                          specthresh = atof(av[1]);
85                          return(1);
86 <                case 'j':                               /* jitter */
86 >                case 's':                               /* sampling */
87                          check(3,"f");
88                          specjitter = atof(av[1]);
89                          return(1);
# Line 98 | Line 102 | getrenderopt(          /* get next render option */
102                  }
103                  break;
104          case 'i':                               /* irradiance */
105 <                bool(2,do_irrad);
105 >                check_bool(2,do_irrad);
106                  return(0);
107          case 'a':                               /* ambient */
108                  switch (av[0][2]) {
# Line 140 | Line 144 | getrenderopt(          /* get next render option */
144                                  amblp = amblist;
145                          }
146                          if (av[0][2] == 'I') {  /* file */
147 <                                rval = wordfile(amblp,
147 >                                rval = wordfile(amblp, AMBLLEN-(amblp-amblist),
148                                          getpath(av[1],getrlibpath(),R_OK));
149                                  if (rval < 0) {
150                                          sprintf(errmsg,
# Line 161 | Line 165 | getrenderopt(          /* get next render option */
165                                  amblp = amblist;
166                          }
167                          if (av[0][2] == 'E') {  /* file */
168 <                                rval = wordfile(amblp,
168 >                                rval = wordfile(amblp, AMBLLEN-(amblp-amblist),
169                                          getpath(av[1],getrlibpath(),R_OK));
170                                  if (rval < 0) {
171                                          sprintf(errmsg,
# Line 205 | Line 209 | getrenderopt(          /* get next render option */
209                  }
210                  break;
211          }
212 <        return(-1);             /* unknown option */
212 >        
213 >        /* PMAP: Parse photon mapping options */
214 >        return(getPmapRenderOpt(ac, av));
215 >        
216 > /*      return(-1); */          /* unknown option */
217  
218   #undef  check
219 < #undef  bool
219 > #undef  check_bool
220   }
221  
222  
223 < extern void
223 > void
224   print_rdefaults(void)           /* print default render values to stdout */
225   {
226          printf(do_irrad ? "-i+\t\t\t\t# irradiance calculation on\n" :
227                          "-i-\t\t\t\t# irradiance calculation off\n");
228 +        printf(rand_samp ? "-u+\t\t\t\t# uncorrelated Monte Carlo sampling\n" :
229 +                        "-u-\t\t\t\t# correlated quasi-Monte Carlo sampling\n");
230          printf(backvis ? "-bv+\t\t\t\t# back face visibility on\n" :
231                          "-bv-\t\t\t\t# back face visibility off\n");
232          printf("-dt %f\t\t\t# direct threshold\n", shadthresh);
# Line 227 | Line 237 | print_rdefaults(void)          /* print default render values
237          printf("-dp %-9d\t\t\t# direct pretest density\n", vspretest);
238          printf(directvis ? "-dv+\t\t\t\t# direct visibility on\n" :
239                          "-dv-\t\t\t\t# direct visibility off\n");
240 <        printf("-sj %f\t\t\t# specular jitter\n", specjitter);
240 >        printf("-ss %f\t\t\t# specular sampling\n", specjitter);
241          printf("-st %f\t\t\t# specular threshold\n", specthresh);
242          printf("-av %f %f %f\t# ambient value\n", colval(ambval,RED),
243                          colval(ambval,GRN), colval(ambval, BLU));
# Line 245 | Line 255 | print_rdefaults(void)          /* print default render values
255                          colval(salbedo,GRN), colval(salbedo,BLU));
256          printf("-mg %f\t\t\t# mist scattering eccentricity\n", seccg);
257          printf("-ms %f\t\t\t# mist sampling distance\n", ssampdist);
258 <        printf("-lr %-9d\t\t\t# limit reflection\n", maxdepth);
259 <        printf("-lw %f\t\t\t# limit weight\n", minweight);
258 >        printf("-lr %-9d\t\t\t# limit reflection%s\n", maxdepth,
259 >                        maxdepth<=0 ? " (Russian roulette)" : "");
260 >        printf("-lw %.2e\t\t\t# limit weight\n", minweight);
261 >        
262 >        /* PMAP: output photon map defaults */
263 >        printPmapDefaults();
264   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines