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.26 by greg, Tue Jan 24 21:54:49 2023 UTC vs.
Revision 2.30 by greg, Thu May 2 15:02:08 2024 UTC

# Line 119 | Line 119 | void   (*trace)() = NULL;              /* trace call */
119  
120   void    (*addobjnotify[8])() = {ambnotify, NULL};
121  
122 + int     castonly = 0;                   /* only doing ray-casting? */
123 +
124   int     do_irrad = 0;                   /* compute irradiance? */
125  
126   int     rand_samp = 1;                  /* pure Monte Carlo sampling? */
# Line 181 | Line 183 | ray_init(                      /* initialize ray-tracing calculation */
183                  initotypes();
184                                          /* initialize urand */
185          reset_random();
186 <                                        /* read scene octree */
187 <        readoct(octname = otnm, ~(IO_FILES|IO_INFO), &thescene, NULL);
186 >                                        /* initialize spectral sampling */
187 >        if (setspectrsamp(CNDX, WLPART) < 0)
188 >                error(USER, "unsupported spectral sampling");
189 >
190 >        octname = savqstr(otnm);        /* read scene octree */
191 >        readoct(octname, ~(IO_FILES|IO_INFO), &thescene, NULL);
192          nsceneobjs = nobjects;
193 <                                        /* PMAP: Init & load photon maps */
194 <        ray_init_pmap();
195 <                                        /* find and mark sources */
196 <        marksources();
197 <                                        /* initialize ambient calculation */
198 <        setambient();
199 <                                        /* ready to go... (almost) */
193 >
194 >        if (!castonly) {                /* any actual ray traversal to do? */
195 >
196 >                ray_init_pmap();        /* PMAP: set up & load photon maps */
197 >
198 >                marksources();          /* find and mark sources */
199 >
200 >                setambient();           /* initialize ambient calculation */
201 >        } else
202 >                distantsources();       /* else mark only distant sources */
203   }
204  
205  
# Line 218 | Line 227 | ray_done(              /* free ray-tracing data */
227          donesets();
228          octdone();
229          thescene.cutree = EMPTY;
230 <        octname = NULL;
230 >        freeqstr(octname); octname = NULL;
231          retainfonts = 0;
232          if (freall) {
233                  freefont(NULL);
# Line 341 | Line 350 | ray_restore(                   /* restore parameter settings */
350          ambincl = rp->ambincl;
351                                          /* update ambient calculation */
352          ambnotify(OVOID);
353 <        if (thescene.cutree != EMPTY) {
353 >        if ((thescene.cutree != EMPTY) & !castonly) {
354                  int     newamb = (ambfile == NULL) ?  rp->ambfile[0] :
355                                          strcmp(ambfile, rp->ambfile) ;
356  
# Line 382 | Line 391 | ray_defaults(          /* get default parameter values */
391          rp->do_irrad = 0;
392          rp->rand_samp = 1;
393          rp->dstrsrc = 0.0;
394 <        rp->shadthresh = .03;
395 <        rp->shadcert = .75;
394 >        rp->shadthresh = 0.03;
395 >        rp->shadcert = 0.75;
396          rp->directrelay = 2;
397          rp->vspretest = 512;
398          rp->directvis = 1;
# Line 392 | Line 401 | ray_defaults(          /* get default parameter values */
401          setcolor(rp->salbedo, 0., 0., 0.);
402          rp->seccg = 0.;
403          rp->ssampdist = 0.;
404 <        rp->specthresh = .15;
404 >        rp->specthresh = 0.15;
405          rp->specjitter = 1.;
406          rp->backvis = 1;
407          rp->maxdepth = -10;
408 <        rp->minweight = 2e-3;
408 >        rp->minweight = 1e-4;
409          memset(rp->ambfile, '\0', sizeof(rp->ambfile));
410          setcolor(rp->ambval, 0., 0., 0.);
411          rp->ambvwt = 0;
412          rp->ambres = 256;
413 <        rp->ambacc = 0.15;
413 >        rp->ambacc = 0.1;
414          rp->ambdiv = 1024;
415          rp->ambssamp = 512;
416          rp->ambounce = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines