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.28 by greg, Sun Apr 30 13:24:36 1995 UTC vs.
Revision 2.29 by greg, Tue May 2 15:28:36 1995 UTC

# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ LBL";
18  
19   #include  "random.h"
20  
21 < #define  OCTSCALE       0.5     /* ceil((valid rad.)/(cube size)) */
21 > #define  OCTSCALE       1.0     /* ceil((valid rad.)/(cube size)) */
22  
23   typedef struct ambtree {
24          AMBVAL  *alist;         /* ambient value list */
# Line 48 | Line 48 | static int  nunflshed = 0;     /* number of unflushed ambi
48   #endif
49   #endif
50   #ifndef SORT_INTVL
51 < #define SORT_INTVL      (SORT_THRESH*32)
51 > #define SORT_INTVL      (SORT_THRESH*256)
52   #endif
53   #ifndef MAX_SORT_INTVL
54 < #define MAX_SORT_INTVL  (SORT_INTVL<<8)
54 > #define MAX_SORT_INTVL  (SORT_INTVL<<4)
55   #endif
56  
57   static unsigned long  ambclock = 0;     /* ambient access clock */
# Line 234 | Line 234 | double s;
234          int  i;
235          register int  j;
236          register AMBVAL  *av;
237 <                                        /* do this node */
237 >
238          wsum = 0.0;
239 +                                        /* do this node */
240          for (av = at->alist; av != NULL; av = av->next) {
241                  if (tracktime)
242                          av->latick = ambclock++;
# Line 249 | Line 250 | double s;
250                  /*
251                   *  Ambient radius test.
252                   */
253 <                e1 = 0.0;
254 <                for (j = 0; j < 3; j++) {
255 <                        d = av->pos[j] - r->rop[j];
256 <                        e1 += d * d;
257 <                }
253 >                d = av->pos[0] - r->rop[0];
254 >                e1 = d * d;
255 >                d = av->pos[1] - r->rop[1];
256 >                e1 += d * d;
257 >                d = av->pos[2] - r->rop[2];
258 >                e1 += d * d;
259                  e1 /= av->rad * av->rad;
260                  if (e1 > ambacc*ambacc*1.21)
261                          continue;
# Line 630 | Line 632 | int    always;
632                   * when we're thrashing, which is when we need to do it.
633                   */
634   #ifdef DEBUG
635 <                sprintf(errmsg, "sorting %u ambient values...", nambvals);
635 >                sprintf(errmsg, "sorting %u ambient values at ambclock=%lu...",
636 >                                nambvals, ambclock);
637                  eputs(errmsg);
638   #endif
639                  i_avlist = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines