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

Comparing ray/src/rt/source.c (file contents):
Revision 2.21 by greg, Mon Dec 11 15:00:24 1995 UTC vs.
Revision 2.23 by greg, Thu Mar 21 15:33:09 1996 UTC

# Line 22 | Line 22 | static char SCCSid[] = "$SunId$ LBL";
22  
23   extern double  ssampdist;               /* scatter sampling distance */
24  
25 + #ifndef MAXSSAMP
26 + #define MAXSSAMP        16              /* maximum samples per ray */
27 + #endif
28 +
29   /*
30   * Structures used by direct()
31   */
# Line 333 | Line 337 | char  *p;                      /* data for f */
337                                  ( sr.ro != source[scp->sno].so ||
338                                  source[scp->sno].sflags & SFOLLOW )) {
339                                                  /* follow entire path */
340 <                        if (!raycont(&sr))
337 <                                objerror(sr.ro, USER, "material not found");
340 >                        raycont(&sr);
341                          rayparticipate(&sr);
342                          if (trace != NULL)
343                                  (*trace)(&sr);  /* trace execution */
# Line 382 | Line 385 | register RAY  *r;
385          COLOR  cumval, ctmp;
386          int  i, j;
387  
388 <        if (r->slights == NULL || r->slights[0] == 0 || r->gecc >= 1.-FTINY)
388 >        if (r->slights == NULL || r->slights[0] == 0
389 >                        || r->gecc >= 1.-FTINY || r->rot >= FHUGE)
390                  return;
391          if (ssampdist <= FTINY || (nsamps = r->rot/ssampdist + .5) < 1)
392                  nsamps = 1;
393 + #if MAXSSAMP
394 +        else if (nsamps > MAXSSAMP)
395 +                nsamps = MAXSSAMP;
396 + #endif
397          oldsampndx = samplendx;
398          samplendx = random()&0x7fff;            /* randomize */
399          for (i = r->slights[0]; i > 0; i--) {   /* for each source */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines