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

Comparing ray/src/rt/virtuals.c (file contents):
Revision 1.21 by greg, Mon Aug 5 09:02:42 1991 UTC vs.
Revision 1.27 by greg, Tue Oct 1 14:29:16 1991 UTC

# Line 19 | Line 19 | static char SCCSid[] = "$SunId$ LBL";
19  
20   #include  "random.h"
21  
22 < #define  MINSAMPLES     5               /* minimum number of pretest samples */
23 < #define  STESTMAX       30              /* maximum seeks per sample */
22 > #define  MINSAMPLES     16              /* minimum number of pretest samples */
23 > #define  STESTMAX       32              /* maximum seeks per sample */
24  
25  
26   double  getdisk();
# Line 287 | Line 287 | register int  sn;      /* target source number */
287          getplaneq(onorm, o);
288                                  /* set number of rays to sample */
289          if (source[sn].sflags & SDISTANT) {
290 <                n = (2./3.*PI*PI)*or2/(thescene.cusize*thescene.cusize)*
291 <                                vspretest + .5;
290 >                                        /* 32. == heuristic constant */
291 >                n = 32.*or2/(thescene.cusize*thescene.cusize)*vspretest + .5;
292                  infront = DOT(onorm, source[sn].sloc) > 0.;
293          } else {
294                  for (i = 0; i < 3; i++)
# Line 319 | Line 319 | register int  sn;      /* target source number */
319   #endif
320                                  return(f);      /* too small a target! */
321                          }
322 +                        multisamp(offsdir, 3, urand(sn*931+5827+ssn));
323                          for (i = 0; i < 3; i++)
324 <                                offsdir[i] = or*(1. -
324 <                                        2.*urand(urind(931*i+5827,ssn)));
324 >                                offsdir[i] = or*(1. - 2.*offsdir[i]);
325                          ssn++;
326                          for (i = 0; i < 3; i++)
327                                  sr.rorg[i] = oc[i] + offsdir[i];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines