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

Comparing ray/src/rt/raycalls.c (file contents):
Revision 2.3 by greg, Thu May 15 05:13:35 2003 UTC vs.
Revision 2.9 by schorsch, Tue Mar 30 16:13:01 2004 UTC

# Line 90 | Line 90 | static const char      RCSid[] = "$Id$";
90   *  same as the defaults for rtrace.)
91   */
92  
93 < #include  "ray.h"
93 > #include <string.h>
94  
95 + #include  "ray.h"
96   #include  "source.h"
96
97   #include  "ambient.h"
98
98   #include  "otypes.h"
100
99   #include  "random.h"
102
100   #include  "data.h"
104
101   #include  "font.h"
102  
103   char    *progname = "unknown_app";      /* caller sets to argv[0] */
# Line 119 | Line 115 | int    samplendx = 0;                  /* index for this sample */
115  
116   void    (*trace)() = NULL;              /* trace call */
117  
118 < extern void     ambnotify();
123 < void    (*addobjnotify[])() = {ambnotify, NULL};
118 > void    (*addobjnotify[8])() = {ambnotify, NULL};
119  
120   int     do_irrad = 0;                   /* compute irradiance? */
121  
122   double  dstrsrc = 0.0;                  /* square source distribution */
123 < double  shadthresh = .05;               /* shadow threshold */
124 < double  shadcert = .5;                  /* shadow certainty */
123 > double  shadthresh = .03;               /* shadow threshold */
124 > double  shadcert = .75;                 /* shadow certainty */
125   int     directrelay = 2;                /* number of source relays */
126   int     vspretest = 512;                /* virtual source pretest density */
127   int     directvis = 1;                  /* sources visible? */
# Line 142 | Line 137 | double specjitter = 1.;                /* specular sampling jitter *
137  
138   int     backvis = 1;                    /* back face visibility */
139  
140 < int     maxdepth = 6;                   /* maximum recursion depth */
141 < double  minweight = 4e-3;               /* minimum ray weight */
140 > int     maxdepth = 8;                   /* maximum recursion depth */
141 > double  minweight = 2e-3;               /* minimum ray weight */
142  
143   char    *ambfile = NULL;                /* ambient file name */
144   COLOR   ambval = BLKCOLOR;              /* ambient value */
145   int     ambvwt = 0;                     /* initial weight for ambient value */
146 < double  ambacc = 0.2;                   /* ambient accuracy */
147 < int     ambres = 128;                   /* ambient resolution */
148 < int     ambdiv = 512;                   /* ambient divisions */
149 < int     ambssamp = 0;                   /* ambient super-samples */
146 > double  ambacc = 0.1;                   /* ambient accuracy */
147 > int     ambres = 256;                   /* ambient resolution */
148 > int     ambdiv = 1024;                  /* ambient divisions */
149 > int     ambssamp = 512;                 /* ambient super-samples */
150   int     ambounce = 0;                   /* ambient bounces */
151   char    *amblist[AMBLLEN+1];            /* ambient include/exclude list */
152   int     ambincl = -1;                   /* include == 1, exclude == 0 */
153  
154  
155 < void
156 < ray_init(otnm)                  /* initialize ray-tracing calculation */
157 < char    *otnm;
155 > extern void
156 > ray_init(                       /* initialize ray-tracing calculation */
157 >        char    *otnm
158 > )
159   {
160          if (nobjects > 0)               /* free old scene data */
161                  ray_done(0);
# Line 167 | Line 163 | char   *otnm;
163          if (ofun[OBJ_SPHERE].funp == o_default)
164                  initotypes();
165                                          /* initialize urand */
166 <        if (urperm == NULL)
171 <                initurand(2048);
166 >        initurand(2048);
167                                          /* read scene octree */
168          readoct(octname = otnm, ~(IO_FILES|IO_INFO), &thescene, NULL);
169          nsceneobjs = nobjects;
# Line 179 | Line 174 | char   *otnm;
174                                          /* ready to go... */
175   }
176  
177 < void
178 < ray_trace(r)                    /* trace a primary ray */
179 < RAY     *r;
177 > extern void
178 > ray_trace(                      /* trace a primary ray */
179 >        RAY     *r
180 > )
181   {
182          rayorigin(r, NULL, PRIMARY, 1.0);
183          samplendx++;
# Line 189 | Line 185 | RAY    *r;
185   }
186  
187  
188 < void
189 < ray_done(freall)                /* free ray-tracing data */
190 < int     freall;
188 > extern void
189 > ray_done(               /* free ray-tracing data */
190 >        int     freall
191 > )
192   {
193          retainfonts = 1;
194          ambdone();
# Line 209 | Line 206 | int    freall;
206                  initurand(0);
207          }
208          if (nobjects > 0) {
209 <                sprintf(errmsg, "%d objects left after call to ray_done()",
209 >                sprintf(errmsg, "%ld objects left after call to ray_done()",
210                                  nobjects);
211                  error(WARNING, errmsg);
212          }
213   }
214  
215  
216 < void
217 < ray_save(rp)                    /* save current parameter settings */
218 < RAYPARAMS       *rp;
216 > extern void
217 > ray_save(                       /* save current parameter settings */
218 >        RAYPARAMS       *rp
219 > )
220   {
221          int     i, ndx;
222  
# Line 242 | Line 240 | RAYPARAMS      *rp;
240          rp->maxdepth = maxdepth;
241          rp->minweight = minweight;
242          copycolor(rp->ambval, ambval);
243 <        bzero(rp->ambfile, sizeof(rp->ambfile));
243 >        memset(rp->ambfile, '\0', sizeof(rp->ambfile));
244          if (ambfile != NULL)
245                  strncpy(rp->ambfile, ambfile, sizeof(rp->ambfile)-1);
246          rp->ambvwt = ambvwt;
# Line 252 | Line 250 | RAYPARAMS      *rp;
250          rp->ambssamp = ambssamp;
251          rp->ambounce = ambounce;
252          rp->ambincl = ambincl;
253 <        bzero(rp->amblval, sizeof(rp->amblval));
253 >        memset(rp->amblval, '\0', sizeof(rp->amblval));
254          ndx = 0;
255          for (i = 0; i < AMBLLEN && amblist[i] != NULL; i++) {
256                  int     len = strlen(amblist[i]);
# Line 266 | Line 264 | RAYPARAMS      *rp;
264   }
265  
266  
267 < void
268 < ray_restore(rp)                 /* restore parameter settings */
269 < RAYPARAMS       *rp;
267 > extern void
268 > ray_restore(                    /* restore parameter settings */
269 >        RAYPARAMS       *rp
270 > )
271   {
272          register int    i;
273  
# Line 333 | Line 332 | RAYPARAMS      *rp;
332   }
333  
334  
335 < void
336 < ray_defaults(rp)                /* get default parameter values */
337 < RAYPARAMS       *rp;
335 > extern void
336 > ray_defaults(           /* get default parameter values */
337 >        RAYPARAMS       *rp
338 > )
339   {
340          int     i;
341  
# Line 344 | Line 344 | RAYPARAMS      *rp;
344  
345          rp->do_irrad = 0;
346          rp->dstrsrc = 0.0;
347 <        rp->shadthresh = .05;
348 <        rp->shadcert = .5;
347 >        rp->shadthresh = .03;
348 >        rp->shadcert = .75;
349          rp->directrelay = 2;
350          rp->vspretest = 512;
351          rp->directvis = 1;
# Line 357 | Line 357 | RAYPARAMS      *rp;
357          rp->specthresh = .15;
358          rp->specjitter = 1.;
359          rp->backvis = 1;
360 <        rp->maxdepth = 6;
361 <        rp->minweight = 4e-3;
360 >        rp->maxdepth = 8;
361 >        rp->minweight = 2e-3;
362          setcolor(rp->ambval, 0., 0., 0.);
363 <        bzero(rp->ambfile, sizeof(rp->ambfile));
363 >        memset(rp->ambfile, '\0', sizeof(rp->ambfile));
364          rp->ambvwt = 0;
365 <        rp->ambres = 128;
366 <        rp->ambacc = 0.2;
367 <        rp->ambdiv = 512;
368 <        rp->ambssamp = 0;
365 >        rp->ambres = 256;
366 >        rp->ambacc = 0.1;
367 >        rp->ambdiv = 1024;
368 >        rp->ambssamp = 512;
369          rp->ambounce = 0;
370          rp->ambincl = -1;
371 <        bzero(rp->amblval, sizeof(rp->amblval));
371 >        memset(rp->amblval, '\0', sizeof(rp->amblval));
372          for (i = AMBLLEN+1; i--; )
373                  rp->amblndx[i] = -1;
374   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines