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.54 by greg, Wed Aug 8 04:15:18 2018 UTC vs.
Revision 2.57 by greg, Mon Jun 10 13:56:52 2019 UTC

# Line 116 | Line 116 | compute_through(BSDFDAT *ndp)
116                                          {0, -1.6},
117                                          {1.6, 0},
118                                  };
119 <        const double    peak_over = 1.5;
119 >        const double    peak_over = 1.3 + .4*frandom(); /* jitter threshold */
120          SDSpectralDF    *dfp;
121          FVECT           pdir;
122          double          tomega, srchrad;
# Line 555 | Line 555 | sample_sdf(BSDFDAT *ndp, int sflags)
555                          rayvalue(&tr);
556                          multcolor(tr.rcol, tr.rcoef);
557                          addcolor(ndp->pr->rcol, tr.rcol);
558 +                        ndp->pr->rxt = ndp->pr->rot + raydistance(&tr);
559                          ++ntotal;
560                          b = bright(ndp->cthru);
561                  } else
# Line 634 | Line 635 | m_bsdf(OBJREC *m, RAY *r)
635                                                  /* get BSDF data */
636          nd.sd = loadBSDF(m->oargs.sarg[hasthick]);
637                                                  /* early shadow check #2 */
638 <        if (r->crtype & SHADOW && (nd.sd->tf == NULL) & (nd.sd->tb == NULL))
638 >        if (r->crtype & SHADOW && (nd.sd->tf == NULL) & (nd.sd->tb == NULL)) {
639 >                SDfreeCache(nd.sd);
640                  return(1);
641 +        }
642                                                  /* diffuse reflectance */
643          if (hitfront) {
644                  cvt_sdcolor(nd.rdiff, &nd.sd->rLambFront);
# Line 691 | Line 694 | m_bsdf(OBJREC *m, RAY *r)
694          }
695          if (ec) {
696                  objerror(m, WARNING, "Illegal orientation vector");
697 +                SDfreeCache(nd.sd);
698                  return(1);
699          }
700          setcolor(nd.cthru, 0, 0, 0);            /* consider through component */
# Line 698 | Line 702 | m_bsdf(OBJREC *m, RAY *r)
702                  compute_through(&nd);
703                  if (r->crtype & SHADOW) {
704                          RAY     tr;             /* attempt to pass shadow ray */
705 +                        SDfreeCache(nd.sd);
706                          if (rayorigin(&tr, TRANS, r, nd.cthru) < 0)
707                                  return(1);      /* no through component */
708                          VCOPY(tr.rdir, r->rdir);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines