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

Comparing ray/src/util/glaresrc.c (file contents):
Revision 1.9 by greg, Thu Mar 21 14:53:56 1991 UTC vs.
Revision 1.10 by greg, Thu Mar 21 17:11:50 1991 UTC

# Line 100 | Line 100 | double br;
100                          d = indirect[i].lcos - tanb*indirect[i].lsin;
101                          if (d > 0.0) {
102                                  indirect[i].sum += d * br;
103 <                                indirect[i].n++;
103 >                                indirect[i].n += d;
104                          }
105                  }
106                  return;
# Line 114 | Line 114 | double br;
114                          d = indirect[i].rcos - tanb*indirect[i].rsin;
115                          if (d > 0.0) {
116                                  indirect[i].sum += d * br;
117 <                                indirect[i].n++;
117 >                                indirect[i].n += d;
118                          }
119                  }
120                  return;
# Line 124 | Line 124 | double br;
124                  d = cos(h_theta(h) - indirect[i].theta);
125                  if (d > 0.0) {
126                          indirect[i].sum += d * br;
127 <                        indirect[i].n++;
127 >                        indirect[i].n += d;
128                  }
129          }
130   }
# Line 359 | Line 359 | absorb(s)                      /* absorb a source into indirect */
359   register struct source  *s;
360   {
361          FVECT   dir;
362 <        register int    i, n;
362 >        double  d;
363 >        register int    i;
364  
365          for (i = 0; i < nglardirs; i++) {
366                  spinvector(dir, ourview.vdir, ourview.vup, indirect[i].theta);
367 <                n = DOT(dir,s->dir)*s->dom*(sampdens*sampdens) + 0.5;
368 <                if (n == 0)
367 >                d = DOT(dir,s->dir)*s->dom*(sampdens*sampdens);
368 >                if (d <= 0.0)
369                          continue;
370 <                indirect[i].sum += n * s->brt;
371 <                indirect[i].n += n;
370 >                indirect[i].sum += d * s->brt;
371 >                indirect[i].n += d;
372          }
373          for ( ; s->first != NULL; s->first = s->first->next)
374                  free((char *)s->first);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines