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.51 by greg, Sat Aug 1 23:27:04 2015 UTC vs.
Revision 2.54 by greg, Mon May 15 22:44:10 2017 UTC

# Line 422 | Line 422 | SDcacheFile(const char *fname)
422          if (fname == NULL || !*fname)
423                  return NULL;
424          SDerrorDetail[0] = '\0';
425 +        /* PLACE MUTEX LOCK HERE FOR THREAD-SAFE */
426          if ((sd = SDgetCache(fname)) == NULL) {
427                  SDreportError(SDEmemory, stderr);
428                  return NULL;
# Line 429 | Line 430 | SDcacheFile(const char *fname)
430          if (!SDisLoaded(sd) && (ec = SDloadFile(sd, fname))) {
431                  SDreportError(ec, stderr);
432                  SDfreeCache(sd);
433 <                return NULL;
433 >                sd = NULL;
434          }
435 +        /* END MUTEX LOCK */
436          return sd;
437   }
438  
# Line 494 | Line 496 | SDsampComponent(SDValue *sv, FVECT ioVec, double randX
496                  sv->cieY = cd->cTotal;
497          if (sv->cieY <= 1e-6) {         /* nothing to sample? */
498                  sv->spec = c_dfcolor;
499 <                memset(ioVec, 0, 3*sizeof(double));
499 >                memset(ioVec, 0, sizeof(FVECT));
500                  return SDEnone;
501          }
502                                          /* compute sample direction */
# Line 644 | Line 646 | SDevalBSDF(SDValue *sv, const FVECT outVec, const FVEC
646          } else if (!(inFront | outFront)) {
647                  *sv = sd->rLambBack;
648                  sdf = sd->rb;
649 <        } else if (inFront) {
649 >        } else if (outFront) {
650                  *sv = sd->tLamb;
651                  sdf = (sd->tf != NULL) ? sd->tf : sd->tb;
652 <        } else /* inBack */ {
652 >        } else /* inFront & !outFront */ {
653                  *sv = sd->tLamb;
654                  sdf = (sd->tb != NULL) ? sd->tb : sd->tf;
655          }
# Line 768 | Line 770 | SDsampBSDF(SDValue *sv, FVECT ioVec, double randX, int
770          }
771          if (sv->cieY <= 1e-6) {         /* anything to sample? */
772                  sv->cieY = .0;
773 <                memset(ioVec, 0, 3*sizeof(double));
773 >                memset(ioVec, 0, sizeof(FVECT));
774                  return SDEnone;
775          }
776                                          /* scale random variable */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines