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

Comparing ray/src/rt/ambient.c (file contents):
Revision 2.39 by greg, Tue Jul 9 19:37:09 1996 UTC vs.
Revision 2.40 by greg, Tue Jul 9 21:56:44 1996 UTC

# Line 50 | Line 50 | static int  nunflshed = 0;     /* number of unflushed ambi
50   #endif
51   #endif
52   #ifndef SORT_INTVL
53 < #define SORT_INTVL      (SORT_THRESH*256)
53 > #define SORT_INTVL      (SORT_THRESH<<4)
54   #endif
55   #ifndef MAX_SORT_INTVL
56 < #define MAX_SORT_INTVL  (SORT_INTVL<<4)
56 > #define MAX_SORT_INTVL  (SORT_INTVL<<8)
57   #endif
58  
59   static COLOR  avsum = BLKCOLOR;         /* computed ambient value sum */
# Line 77 | Line 77 | static long  sortintvl = SORT_INTVL;   /* time until nex
77   #define  newambval()    (AMBVAL *)bmalloc(sizeof(AMBVAL))
78  
79   extern long  ftell(), lseek();
80 < static int  initambfile(), avsave(), avinsert(), sortambvals();
80 > static int  initambfile(), avsave(), avinsert(), sortambvals(), avlmemi();
81   static AMBVAL  *avstore();
82   #ifdef  F_SETLKW
83   static  aflock();
# Line 210 | Line 210 | FVECT  nrm;
210                          goto dumbamb;
211                  return;
212          }
213 <                                                /* resort memory? */
214 <        sortambvals(0);
213 >
214 >        if (tracktime)                          /* sort to minimize thrashing */
215 >                sortambvals(0);
216                                                  /* get ambient value */
217          setcolor(acol, 0.0, 0.0, 0.0);
218          d = sumambient(acol, r, nrm, rdepth,
# Line 257 | Line 258 | double s;
258                                          /* do this node */
259          for (av = at->alist; av != NULL; av = av->next) {
260                  if (tracktime)
261 <                        av->latick = ambclock++;
261 >                        av->latick = ambclock;
262                  /*
263                   *  Ambient level test.
264                   */
# Line 616 | Line 617 | int    always;
617          AMBVAL  tav, *tap, *pnext;
618          register int    i, j;
619                                          /* see if it's time yet */
620 <        if (!always && (ambclock < lastsort+sortintvl ||
620 >        if (!always && (ambclock++ < lastsort+sortintvl ||
621                          nambvals < SORT_THRESH))
622                  return;
623          /*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines