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

Comparing ray/src/common/bsdf.c (file contents):
Revision 2.55 by greg, Thu May 10 22:55:35 2018 UTC vs.
Revision 2.58 by greg, Thu May 14 19:20:13 2020 UTC

# Line 47 | Line 47 | const SDCDst           SDemptyCD;
47   /* Cache of loaded BSDFs */
48   struct SDCache_s        *SDcacheList = NULL;
49  
50 < /* Retain BSDFs in cache list */
50 > /* Retain BSDFs in cache list? */
51   int                     SDretainSet = SDretainNone;
52  
53 + /* Maximum cache size for any given BSDF? */
54 + unsigned long           SDmaxCache = 0;         /* 0 == unlimited */
55 +
56   /* Report any error to the indicated stream */
57   SDError
58   SDreportError(SDError ec, FILE *fp)
# Line 645 | Line 648 | SDevalBSDF(SDValue *sv, const FVECT outVec, const FVEC
648          } else if (!(inFront | outFront)) {
649                  *sv = sd->rLambBack;
650                  sdf = sd->rb;
651 <        } else if (outFront) {
651 >        } else if (inFront) {
652                  *sv = sd->tLamb;
653                  sdf = (sd->tf != NULL) ? sd->tf : sd->tb;
654 <        } else /* inFront & !outFront */ {
654 >        } else /* outFront & !inFront */ {
655                  *sv = sd->tLamb;
656                  sdf = (sd->tb != NULL) ? sd->tb : sd->tf;
657          }
# Line 789 | Line 792 | SDsampBSDF(SDValue *sv, FVECT ioVec, double randX, int
792                  randX -= sd->tLamb.cieY;
793          }
794                                          /* else one of cumulative dist. */
795 <        for (i = 0; i < n && randX > cdarr[i]->cTotal; i++)
795 >        for (i = 0; i < n && randX >= cdarr[i]->cTotal; i++)
796                  randX -= cdarr[i]->cTotal;
797          if (i >= n)
798                  return SDEinternal;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines