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.14 by greg, Wed Jul 19 18:47:01 1989 UTC vs.
Revision 1.19 by greg, Thu Jan 11 11:06:22 1990 UTC

# Line 329 | Line 329 | char  *p;                      /* data for f */
329                                                  /* compute coefficient */
330                  (*f)(srccnt[sn].val, p, srccnt[sn].dir, srccnt[sn].dom);
331                  cntord[sn].brt = bright(srccnt[sn].val);
332 <                if (cntord[sn].brt <= FTINY)
332 >                if (cntord[sn].brt <= 0.0)
333                          continue;
334                                                  /* compute intersection */
335                  if (!( source[sn].sflags & SDISTANT ?
# Line 338 | Line 338 | char  *p;                      /* data for f */
338                                  (source[sn].so, &sr) ))
339                          continue;
340                                                  /* compute contribution */
341 <                rayshade(&sr, sr.ro->omod);
341 >                raycont(&sr);
342                  multcolor(srccnt[sn].val, sr.rcol);
343                  cntord[sn].brt = bright(srccnt[sn].val);
344          }
# Line 376 | Line 376 | char  *p;                      /* data for f */
376                                                  /* test for hit */
377                  rayorigin(&sr, r, SHADOW, 1.0);
378                  VCOPY(sr.rdir, srccnt[cntord[sn].sno].dir);
379 +                sr.rsrc = cntord[sn].sno;
380                  if (localhit(&sr, &thescene) &&
381                                  sr.ro != source[cntord[sn].sno].so) {
382                                                  /* check for transmission */
383 <                        rayshade(&sr, sr.ro->omod);
383 >                        raycont(&sr);
384                          if (bright(sr.rcol) <= FTINY)
385                                  continue;       /* missed! */
386                          (*f)(srccnt[cntord[sn].sno].val, p,
# Line 394 | Line 395 | char  *p;                      /* data for f */
395          }
396                                          /* weighted hit rate */
397          hwt = hit2 / test2;
398 < #ifdef DEBUG
398 > #ifdef notdef
399          sprintf(errmsg, "%d tested, %d untested, %f hit rate\n",
400                          sn, ncnts-sn, hwt);
401          eputs(errmsg);
# Line 428 | Line 429 | m_light(m, r)                  /* ray hit a light source */
429   register OBJREC  *m;
430   register RAY  *r;
431   {
431                                                /* check for behind */
432        if (r->rod < 0.0)
433                return;
432                                                  /* check for over-counting */
433          if (wrongsource(m, r) || badambient(m, r))
434                  return;
# Line 444 | Line 442 | register RAY  *r;
442  
443                                                  /* otherwise treat as source */
444          } else {
445 +                                                /* check for behind */
446 +                if (r->rod < 0.0)
447 +                        return;
448                                                  /* get distribution pattern */
449                  raytexture(r, m->omod);
450                                                  /* get source color */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines