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

Comparing ray/src/util/cmbsdf.c (file contents):
Revision 2.7 by greg, Wed Sep 11 00:24:03 2019 UTC vs.
Revision 2.8 by greg, Tue Mar 17 23:24:05 2020 UTC

# Line 123 | Line 123 | cm_bsdf_recip(const COLOR diffBSDF, const SDMat *bsdf)
123   static CMATRIX *
124   cm_bsdf_Lamb(const COLOR diffBSDF)
125   {
126 <        CMATRIX *cm = cm_alloc(145, 145);       /* this is a hack */
127 <        int     r, c;
126 >        CMATRIX         *cm = cm_alloc(145, 145);       /* this is a hack */
127 >        ANGLE_BASIS     *abase = abase_list;
128 >        int             r, c;
129  
130 <        for (c = 0; c < cm->ncols; c++)
130 >        while (abase->nangles != cm->nrows)
131 >                if (++abase >= abase_list+nabases)
132 >                        error(INTERNAL, "Code error in cm_bsdf_Lamb()");
133 >
134 >        for (c = 0; c < cm->ncols; c++) {
135 >                const double    dom = io_getohm(c,abase);
136                  for (r = 0; r < cm->nrows; r++) {
137                          COLORV  *mp = cm_lval(cm,r,c);
138                          copycolor(mp, diffBSDF);
139 +                        scalecolor(mp, dom);
140                  }
141 +        }
142          return(cm);
143   }
144  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines