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.41 by greg, Tue Jul 18 21:33:14 2017 UTC

# Line 431 | Line 431 | dir_btdf(
431   static int
432   sample_sdcomp(BSDFDAT *ndp, SDComponent *dcp, int xmit)
433   {
434 <        int     hasthru = (xmit && !(ndp->pr->crtype & (SPECULAR|AMBIENT))
435 <                                && bright(ndp->cthru) > FTINY);
436 <        int     nstarget = 1;
437 <        int     nsent = 0;
438 <        int     n;
439 <        SDError ec;
440 <        SDValue bsv;
441 <        double  xrand;
442 <        FVECT   vsmp, vinc;
443 <        RAY     sr;
434 >        const int       hasthru = (xmit &&
435 >                                !(ndp->pr->crtype & (SPECULAR|AMBIENT)) &&
436 >                                bright(ndp->cthru) > FTINY);
437 >        int             nstarget = 1;
438 >        int             nsent = 0;
439 >        int             n;
440 >        SDError         ec;
441 >        SDValue         bsv;
442 >        double          xrand;
443 >        FVECT           vsmp, vinc;
444 >        RAY             sr;
445                                                  /* multiple samples? */
446          if (specjitter > 1.5) {
447                  nstarget = specjitter*ndp->pr->rweight + .5;
# Line 522 | Line 523 | sample_sdf(BSDFDAT *ndp, int sflags)
523          if (dfp == NULL)                        /* no specular component? */
524                  return(0);
525  
525        dimlist[ndims++] = (int)(size_t)ndp->mp;
526          if (hasthru) {                          /* separate view sample? */
527                  RAY     tr;
528                  if (rayorigin(&tr, TRANS, ndp->pr, ndp->cthru) == 0) {
# Line 535 | Line 535 | sample_sdf(BSDFDAT *ndp, int sflags)
535                  } else
536                          hasthru = 0;
537          }
538        ndims--;
538          if (dfp->maxHemi - b <= FTINY) {        /* how specular to sample? */
539                  b = 0;
540          } else {
# Line 554 | Line 553 | sample_sdf(BSDFDAT *ndp, int sflags)
553                  }
554                  return(ntotal);
555          }
556 <        ndims += 2;                             /* else sample specular */
556 >        dimlist[ndims] = (int)(size_t)ndp->mp;  /* else sample specular */
557 >        ndims += 2;
558          for (n = dfp->ncomp; n--; ) {           /* loop over components */
559                  dimlist[ndims-1] = n + 9438;
560                  ntotal += sample_sdcomp(ndp, &dfp->comp[n], sflags==SDsampSpT);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines