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

Comparing ray/src/rt/m_bsdf.c (file contents):
Revision 2.45 by greg, Fri Jan 5 02:47:46 2018 UTC vs.
Revision 2.46 by greg, Mon Feb 12 18:46:29 2018 UTC

# Line 116 | Line 116 | compute_through(BSDFDAT *ndp)
116  
117          setcolor(ndp->cthru, 0, 0, 0);          /* starting assumption */
118  
119 +        if (ndp->pr->crtype & (SPECULAR|AMBIENT) && !(ndp->pr->crtype & SHADOW))
120 +                return;                         /* no need for through comp. */
121 +
122          if (ndp->pr->rod > 0)
123                  dfp = (ndp->sd->tf != NULL) ? ndp->sd->tf : ndp->sd->tb;
124          else
# Line 441 | Line 444 | dir_btdf(
444   static int
445   sample_sdcomp(BSDFDAT *ndp, SDComponent *dcp, int xmit)
446   {
447 <        const int       hasthru = (xmit &&
445 <                                !(ndp->pr->crtype & (SPECULAR|AMBIENT)) &&
446 <                                bright(ndp->cthru) > FTINY);
447 >        const int       hasthru = (xmit && bright(ndp->cthru) > FTINY);
448          int             nstarget = 1;
449          int             nsent = 0;
450          int             n;
# Line 508 | Line 509 | sample_sdcomp(BSDFDAT *ndp, SDComponent *dcp, int xmit
509   static int
510   sample_sdf(BSDFDAT *ndp, int sflags)
511   {
512 <        int             hasthru = (sflags == SDsampSpT
513 <                                    && !(ndp->pr->crtype & (SPECULAR|AMBIENT))
513 <                                    && bright(ndp->cthru) > FTINY);
512 >        int             hasthru = (sflags == SDsampSpT &&
513 >                                        bright(ndp->cthru) > FTINY);
514          int             n, ntotal = 0;
515          double          b = 0;
516          SDSpectralDF    *dfp;
# Line 676 | Line 676 | m_bsdf(OBJREC *m, RAY *r)
676          if (r->crtype & SHADOW) {
677                  RAY     tr;                     /* attempt to pass shadow ray */
678                  if (rayorigin(&tr, TRANS, r, nd.cthru) < 0)
679 <                        return(1);              /* blocked */
679 >                        return(1);              /* no through component */
680                  VCOPY(tr.rdir, r->rdir);
681                  rayvalue(&tr);                  /* transmit with scaling */
682                  multcolor(tr.rcol, tr.rcoef);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines