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

Comparing ray/src/rt/rcontrib.c (file contents):
Revision 2.13 by greg, Fri Jun 22 22:03:02 2012 UTC vs.
Revision 2.15 by greg, Fri Jul 13 05:07:06 2012 UTC

# Line 8 | Line 8 | static const char RCSid[] = "$Id$";
8  
9   #include "rcontrib.h"
10   #include "otypes.h"
11 + #include "source.h"
12  
13   char    *shm_boundary = NULL;           /* boundary of shared memory */
14  
# Line 176 | Line 177 | rcinit()
177                                          /* set shared memory boundary */
178                  shm_boundary = strcpy((char *)malloc(16), "SHM_BOUNDARY");
179          }
180 +        for (i = 0; i < nsources; i++)  /* tracing to sources as well */
181 +                source[i].sflags |= SFOLLOW;
182          if (yres > 0) {                 /* set up flushing & ray counts */
183                  if (xres > 0)
184                          raysleft = (RNUMBER)xres*yres;
# Line 223 | Line 226 | trace_contrib(RAY *r)
226  
227          if (mp == NULL)                         /* not in our list? */
228                  return;
229 +                                                /* shadow ray not on source? */
230 +        if (r->rsrc >= 0 && source[r->rsrc].so != r->ro)
231 +                return;
232  
233 <        worldfunc(RCCONTEXT, r);                /* get bin number */
233 >        worldfunc(RCCONTEXT, r);                /* else get bin number */
234          bn = (int)(evalue(mp->binv) + .5);
235          if ((bn < 0) | (bn >= mp->nbins)) {
236                  error(WARNING, "bad bin number (ignored)");
237                  return;
238          }
239 <        raycontrib(contr, r, PRIMARY);
239 >        raycontrib(contr, r, PRIMARY);          /* compute coefficient */
240          if (contrib)
241 <                multcolor(contr, r->rcol);
241 >                multcolor(contr, r->rcol);      /* -> contribution */
242          addcolor(mp->cbin[bn], contr);
243   }
244  
# Line 251 | Line 257 | eval_irrad(FVECT org, FVECT dir)
257          rayorigin(&thisray, PRIMARY, NULL, NULL);
258          thisray.rot = 1e-5;             /* pretend we hit surface */
259          thisray.rod = 1.0;
260 +        VCOPY(thisray.ron, dir);
261          VSUM(thisray.rop, org, dir, 1e-4);
262          samplendx++;                    /* compute result */
263          (*ofun[Lamb.otype].funp)(&Lamb, &thisray);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines