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.57 by greg, Fri Mar 8 03:42:12 2019 UTC

# Line 645 | Line 645 | SDevalBSDF(SDValue *sv, const FVECT outVec, const FVEC
645          } else if (!(inFront | outFront)) {
646                  *sv = sd->rLambBack;
647                  sdf = sd->rb;
648 <        } else if (outFront) {
648 >        } else if (inFront) {
649                  *sv = sd->tLamb;
650                  sdf = (sd->tf != NULL) ? sd->tf : sd->tb;
651 <        } else /* inFront & !outFront */ {
651 >        } else /* outFront & !inFront */ {
652                  *sv = sd->tLamb;
653                  sdf = (sd->tb != NULL) ? sd->tb : sd->tf;
654          }
# Line 789 | Line 789 | SDsampBSDF(SDValue *sv, FVECT ioVec, double randX, int
789                  randX -= sd->tLamb.cieY;
790          }
791                                          /* else one of cumulative dist. */
792 <        for (i = 0; i < n && randX > cdarr[i]->cTotal; i++)
792 >        for (i = 0; i < n && randX >= cdarr[i]->cTotal; i++)
793                  randX -= cdarr[i]->cTotal;
794          if (i >= n)
795                  return SDEinternal;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines