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.29 by greg, Thu Apr 2 16:40:32 2015 UTC vs.
Revision 3.30 by greg, Sun Apr 5 01:32:01 2015 UTC

# Line 64 | Line 64 | ANGLE_BASIS    abase_list[MAXABASES] = {
64  
65   int             nabases = 3;            /* current number of defined bases */
66  
67 < C_COLOR mtx_RGB_prim[3];                /* our RGB primaries  */
68 < float   mtx_RGB_coef[3];                /* corresponding Y coefficients */
67 > C_COLOR         mtx_RGB_prim[3];        /* our RGB primaries  */
68 > float           mtx_RGB_coef[3];        /* corresponding Y coefficients */
69  
70   enum {mtx_Y, mtx_X, mtx_Z};             /* matrix components (mtx_Y==0) */
71  
# Line 621 | Line 621 | subtract_min(C_COLOR *cs, SDMat *sm)
621                          while (c--)
622                                  coef[c] = (coef[c] - min_coef[c]) /
623                                                  mtx_RGB_coef[c];
624 <                        c_fromSharpRGB(coef, &cxy);
625 <                        sm->chroma[o*sm->ninc + i] = c_encodeChroma(&cxy);
624 >                        if (c_fromSharpRGB(coef, &cxy) > 1e-5)
625 >                                sm->chroma[o*sm->ninc + i] = c_encodeChroma(&cxy);
626                          mBSDF_value(sm,i,o) -= min_coef[0]+min_coef[1]+min_coef[2];
627                  }
628
628                                          /* return colored minimum */
629 <        c_cmix(cs, min_coef[0], &mtx_RGB_prim[0], min_coef[1], &mtx_RGB_prim[1]);
630 <        c_cmix(cs, min_coef[0]+min_coef[1], cs, min_coef[2], &mtx_RGB_prim[2]);
629 >        for (i = 3; i--; )
630 >                coef[i] = min_coef[i]/mtx_RGB_coef[i];
631 >        c_fromSharpRGB(coef, cs);
632  
633          return (min_coef[0]+min_coef[1]+min_coef[2])*M_PI;
634   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines