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.40 by greg, Sat Mar 27 16:40:46 2021 UTC vs.
Revision 3.45 by greg, Tue Jan 25 01:34:20 2022 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 295 | Line 295 | int
295   mBSDF_color(float coef[], const SDMat *dp, int i, int o)
296   {
297          C_COLOR cxy;
298 +        double  d;
299  
300          coef[0] = mBSDF_value(dp, o, i);
301 +                                /* position-specific perturbation */
302 +        d = 2*dp->ninc/(i + .22545) + 4*dp->nout/(o + .70281);
303 +        d -= (int)d;
304 +        coef[0] *= 1. + 6e-4*(d - .5);
305          if (dp->chroma == NULL)
306                  return 1;       /* grayscale */
307  
# Line 709 | Line 714 | SDloadMtx(SDData *sd, ezxml_t wtl)
714                                          /* separate diffuse components */
715          sd->rf = extract_diffuse(&sd->rLambFront, sd->rf);
716          sd->rb = extract_diffuse(&sd->rLambBack, sd->rb);
717 <        if (sd->tb != NULL)
718 <                sd->tb = extract_diffuse(&sd->tLamb, sd->tb);
719 <        if (sd->tf != NULL)
720 <                sd->tf = extract_diffuse(&sd->tLamb, sd->tf);
717 >        sd->tf = extract_diffuse(&sd->tLambFront, sd->tf);
718 >        if (sd->tb != NULL) {
719 >                sd->tb = extract_diffuse(&sd->tLambBack, sd->tb);
720 >                if (sd->tf == NULL)
721 >                        sd->tLambFront = sd->tLambBack;
722 >        } else if (sd->tf != NULL)
723 >                sd->tLambBack = sd->tLambFront;
724                                          /* return success */
725          return SDEnone;
726   }
727  
728   /* Get Matrix BSDF value */
729   static int
730 < SDgetMtxBSDF(float coef[SDmaxCh], const FVECT outVec,
731 <                                const FVECT inVec, SDComponent *sdc)
730 > SDgetMtxBSDF(float coef[SDmaxCh], const FVECT inVec,
731 >                                const FVECT outVec, SDComponent *sdc)
732   {
733          const SDMat     *dp;
734          int             i_ndx, o_ndx;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines