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 1.40 by greg, Tue Jul 30 18:23:41 1991 UTC vs.
Revision 1.43 by greg, Tue Aug 13 12:16:37 1991 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1990 Regents of the University of California */
1 > /* Copyright (c) 1991 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 140 | Line 140 | register int  sn;              /* source number */
140          }
141          if (dstrsrc > FTINY) {
142                                          /* distribute source direction */
143 <                dimlist[ndims++] = sn;
144 <                for (i = 0; i < 3; i++) {
145 <                        dimlist[ndims] = i + 8831;
146 <                        vd[i] = dstrsrc * source[sn].ss *
147 <                (1.0 - 2.0*urand(urind(ilhash(dimlist,ndims+1),samplendx)));
148 <                }
149 <                ndims--;
143 >                dimlist[ndims] = sn + 8831;
144 >                peano(vd, 3, urand(ilhash(dimlist,ndims+1)+samplendx), .01);
145 >                for (i = 0; i < 3; i++)
146 >                        vd[i] = dstrsrc * source[sn].ss * (1. - 2.*vd[i]);
147                  if (source[sn].sflags & SFLAT) {        /* project offset */
148                          d = DOT(vd, source[sn].snorm);
149                          for (i = 0; i < 3; i++)
# Line 164 | Line 161 | register int  sn;              /* source number */
161          if (source[sn].sflags & SDISTANT) {
162                  if (source[sn].sflags & SSPOT) {        /* check location */
163                          for (i = 0; i < 3; i++)
164 <                                vd[i] = sr->rorg[i] - source[sn].sl.s->aim[i];
164 >                                vd[i] = source[sn].sl.s->aim[i] - sr->rorg[i];
165                          d = DOT(sr->rdir,vd);
166 +                        if (d <= FTINY)
167 +                                return(0.0);
168                          d = DOT(vd,vd) - d*d;
169                          if (PI*d > source[sn].sl.s->siz)
170                                  return(0.0);
# Line 245 | Line 244 | RAY  *r;                       /* ray that hit surface */
244   int  (*f)();                    /* direct component coefficient function */
245   char  *p;                       /* data for f */
246   {
247 +        extern int  (*trace)();
248          extern double  pow();
249          register int  sn;
250          int  nshadcheck, ncnts;
# Line 314 | Line 314 | char  *p;                      /* data for f */
314                                  source[cntord[sn].sno].sflags & SFOLLOW )) {
315                                                  /* follow entire path */
316                          raycont(&sr);
317 +                        if (trace != NULL)
318 +                                (*trace)(&sr);  /* trace execution */
319                          if (bright(sr.rcol) <= FTINY)
320                                  continue;       /* missed! */
321                          copycolor(srccnt[cntord[sn].sno].val, sr.rcol);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines