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.40 by greg, Mon Jul 17 00:14:28 2017 UTC vs.
Revision 2.42 by greg, Tue Nov 28 22:17:00 2017 UTC

# Line 128 | Line 128 | compute_through(BSDFDAT *ndp)
128          srchrad = sqrt(dfp->minProjSA);         /* else search for peak */
129          setcolor(vpeak, 0, 0, 0);
130          setcolor(vsum, 0, 0, 0);
131 +        pdir[2] = 0.0;
132          for (i = 0; i < NDIR2CHECK; i++) {
133                  FVECT   tdir;
134                  SDValue sv;
# Line 146 | Line 147 | compute_through(BSDFDAT *ndp)
147                          VCOPY(pdir, tdir);
148                  }
149          }
150 +        if (pdir[2] == 0.0)
151 +                return;                         /* zero neighborhood */
152          ec = SDsizeBSDF(&tomega, pdir, ndp->vray, SDqueryMin, ndp->sd);
153          if (ec)
154                  goto baderror;
# Line 431 | Line 434 | dir_btdf(
434   static int
435   sample_sdcomp(BSDFDAT *ndp, SDComponent *dcp, int xmit)
436   {
437 <        int     hasthru = (xmit && !(ndp->pr->crtype & (SPECULAR|AMBIENT))
438 <                                && bright(ndp->cthru) > FTINY);
439 <        int     nstarget = 1;
440 <        int     nsent = 0;
441 <        int     n;
442 <        SDError ec;
443 <        SDValue bsv;
444 <        double  xrand;
445 <        FVECT   vsmp, vinc;
446 <        RAY     sr;
437 >        const int       hasthru = (xmit &&
438 >                                !(ndp->pr->crtype & (SPECULAR|AMBIENT)) &&
439 >                                bright(ndp->cthru) > FTINY);
440 >        int             nstarget = 1;
441 >        int             nsent = 0;
442 >        int             n;
443 >        SDError         ec;
444 >        SDValue         bsv;
445 >        double          xrand;
446 >        FVECT           vsmp, vinc;
447 >        RAY             sr;
448                                                  /* multiple samples? */
449          if (specjitter > 1.5) {
450                  nstarget = specjitter*ndp->pr->rweight + .5;
# Line 522 | Line 526 | sample_sdf(BSDFDAT *ndp, int sflags)
526          if (dfp == NULL)                        /* no specular component? */
527                  return(0);
528  
525        dimlist[ndims++] = (int)(size_t)ndp->mp;
529          if (hasthru) {                          /* separate view sample? */
530                  RAY     tr;
531                  if (rayorigin(&tr, TRANS, ndp->pr, ndp->cthru) == 0) {
# Line 535 | Line 538 | sample_sdf(BSDFDAT *ndp, int sflags)
538                  } else
539                          hasthru = 0;
540          }
538        ndims--;
541          if (dfp->maxHemi - b <= FTINY) {        /* how specular to sample? */
542                  b = 0;
543          } else {
# Line 554 | Line 556 | sample_sdf(BSDFDAT *ndp, int sflags)
556                  }
557                  return(ntotal);
558          }
559 <        ndims += 2;                             /* else sample specular */
559 >        dimlist[ndims] = (int)(size_t)ndp->mp;  /* else sample specular */
560 >        ndims += 2;
561          for (n = dfp->ncomp; n--; ) {           /* loop over components */
562                  dimlist[ndims-1] = n + 9438;
563                  ntotal += sample_sdcomp(ndp, &dfp->comp[n], sflags==SDsampSpT);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines