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.35 by greg, Thu Aug 27 04:33:31 2015 UTC vs.
Revision 3.38 by greg, Thu May 10 22:55:35 2018 UTC

# Line 191 | Line 191 | fo_getndx(const FVECT v, void *p)
191   double
192   io_getohm(int ndx, void *p)
193   {
194 +        static void     *last_p = NULL;
195          static int      last_li = -1;
196          static double   last_ohm;
197          ANGLE_BASIS     *ab = (ANGLE_BASIS *)p;
# Line 201 | Line 202 | io_getohm(int ndx, void *p)
202                  return -1.;
203          for (li = 0; ndx >= ab->lat[li].nphis; li++)
204                  ndx -= ab->lat[li].nphis;
205 <        if (li == last_li)                      /* cached latitude? */
205 >        if ((p == last_p) & (li == last_li))            /* cached latitude? */
206                  return last_ohm;
207 +        last_p = p;
208          last_li = li;
209          theta = M_PI/180. * ab->lat[li].tmin;
210          theta1 = M_PI/180. * ab->lat[li+1].tmin;
# Line 647 | Line 649 | extract_diffuse(SDValue *dv, SDSpectralDF *df)
649                                          /* subtract minimum value */
650          dv->cieY = subtract_min(&dv->spec, (SDMat *)df->comp[0].dist);
651          df->maxHemi -= dv->cieY;        /* adjust maximum hemispherical */
652 <                                        /* make sure everything is set */
653 <        c_ccvt(&dv->spec, C_CSXY+C_CSSPEC);
652 >                                
653 >        c_ccvt(&dv->spec, C_CSXY);      /* make sure (x,y) is set */
654          return df;
655   }
656  
# Line 906 | Line 908 | SDsampMtxCDist(FVECT ioVec, double randX, const SDCDst
908   }
909  
910   /* Fixed resolution BSDF methods */
911 < SDFunc                  SDhandleMtx = {
911 > const SDFunc            SDhandleMtx = {
912                                  &SDgetMtxBSDF,
913                                  &SDqueryMtxProjSA,
914                                  &SDgetMtxCDist,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines