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 2.50 by greg, Tue Apr 19 01:15:07 2005 UTC vs.
Revision 2.54 by greg, Wed Jul 12 05:47:05 2006 UTC

# Line 55 | Line 55 | findmaterial(register OBJREC *o)
55                          ao = objptr(aobj);
56                          if (ismaterial(ao->otype))
57                                  return(ao);
58 +                        if (ao->otype == MOD_ALIAS) {
59 +                                o = ao;
60 +                                continue;
61 +                        }
62                  }
63                  if (o->omod == OVOID)
64                          return(NULL);
# Line 382 | Line 386 | direct(                                        /* add direct component */
386                  scp->sno = sr.rsrc;
387                                                  /* compute coefficient */
388                  (*f)(scp->coef, p, sr.rdir, si.dom);
389 <                cntord[sn].brt = bright(scp->coef);
389 >                cntord[sn].brt = intens(scp->coef);
390                  if (cntord[sn].brt <= 0.0)
391                          continue;
392   #if SHADCACHE
# Line 395 | Line 399 | direct(                                        /* add direct component */
399                  VCOPY(scp->dir, sr.rdir);
400                  copycolor(sr.rcoef, scp->coef);
401                                                  /* compute potential */
402 <                srcvalue(&sr);
402 >                sr.revf = srcvalue;
403 >                rayvalue(&sr);
404                  multcolor(sr.rcol, sr.rcoef);
405                  copycolor(scp->val, sr.rcol);
406 <                cntord[sn].brt = bright(scp->val);
406 >                cntord[sn].brt = intens(sr.rcol);
407          }
408                                                  /* sort contributions */
409          qsort(cntord, sn, sizeof(CNTPTR), cntcmp);
# Line 437 | Line 442 | direct(                                        /* add direct component */
442                  scp = srccnt + cntord[sn].sndx;
443                                                  /* test for hit */
444                  rayorigin(&sr, SHADOW, r, NULL);
445 +                copycolor(sr.rcoef, scp->coef);
446                  VCOPY(sr.rdir, scp->dir);
447                  sr.rsrc = scp->sno;
448                                                  /* keep statistics */
# Line 461 | Line 467 | direct(                                        /* add direct component */
467   #endif
468                                  continue;       /* missed! */
469                          }
470 +                        multcolor(sr.rcol, sr.rcoef);
471                          copycolor(scp->val, sr.rcol);
472 <                        multcolor(scp->val, scp->coef);
472 >                } else if (trace != NULL &&
473 >                        (source[scp->sno].sflags & (SDISTANT|SVIRTUAL|SFOLLOW))
474 >                                                == (SDISTANT|SFOLLOW) &&
475 >                                sourcehit(&sr) && rayshade(&sr, sr.ro->omod)) {
476 >                        (*trace)(&sr);          /* trace execution */
477 >                        /* skip call to rayparticipate() & scp->val update */
478                  }
479                                                  /* add contribution if hit */
480                  addcolor(r->rcol, scp->val);
# Line 484 | Line 496 | direct(                                        /* add direct component */
496                  scp = srccnt + cntord[sn].sndx;
497                  prob = hwt * (double)source[scp->sno].nhits /
498                                  (double)source[scp->sno].ntests;
499 <                if (prob > 1.0)
500 <                        prob = 1.0;
489 <                scalecolor(scp->val, prob);
499 >                if (prob < 1.0)
500 >                        scalecolor(scp->val, prob);
501                  addcolor(r->rcol, scp->val);
502          }
503   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines