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

Comparing ray/src/common/bsdf_m.c (file contents):
Revision 3.41 by greg, Sat Mar 27 17:50:18 2021 UTC vs.
Revision 3.44 by greg, Fri Dec 17 20:51:55 2021 UTC

# Line 171 | Line 171 | fo_getndx(const FVECT v, void *p)
171  
172          if (v == NULL)
173                  return -1;
174 <        if ((v[2] < 0) | (v[2] > 1.))
174 >        if ((v[2] < 0) | (v[2] > 1.00001))
175                  return -1;
176          pol = 180.0/M_PI*Acos(v[2]);
177          azi = 180.0/M_PI*atan2(v[1], v[0]);
# Line 710 | Line 710 | SDloadMtx(SDData *sd, ezxml_t wtl)
710          sd->rf = extract_diffuse(&sd->rLambFront, sd->rf);
711          sd->rb = extract_diffuse(&sd->rLambBack, sd->rb);
712          sd->tf = extract_diffuse(&sd->tLambFront, sd->tf);
713 <        sd->tb = extract_diffuse(&sd->tLambBack, sd->tb);
713 >        if (sd->tb != NULL) {
714 >                sd->tb = extract_diffuse(&sd->tLambBack, sd->tb);
715 >                if (sd->tf == NULL)
716 >                        sd->tLambFront = sd->tLambBack;
717 >        } else if (sd->tf != NULL)
718 >                sd->tLambBack = sd->tLambFront;
719                                          /* return success */
720          return SDEnone;
721   }
722  
723   /* Get Matrix BSDF value */
724   static int
725 < SDgetMtxBSDF(float coef[SDmaxCh], const FVECT outVec,
726 <                                const FVECT inVec, SDComponent *sdc)
725 > SDgetMtxBSDF(float coef[SDmaxCh], const FVECT inVec,
726 >                                const FVECT outVec, SDComponent *sdc)
727   {
728          const SDMat     *dp;
729          int             i_ndx, o_ndx;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines