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

Comparing ray/src/common/bsdf_t.c (file contents):
Revision 3.45 by greg, Fri Jan 5 21:00:24 2018 UTC vs.
Revision 3.46 by greg, Tue Apr 17 18:11:16 2018 UTC

# Line 1176 | Line 1176 | SDsubtractTreVal(SDNode *st, float val)
1176   static double
1177   subtract_min_Y(SDNode *st)
1178   {
1179 <        float   vmin;
1179 >        const float     vmaxmin = 1.5/M_PI;
1180 >        float           vmin;
1181                                          /* be sure to skip unused portion */
1182          if (st->ndim == 3) {
1183                  int     n;
1184 <                vmin = 1./M_PI;
1184 >                vmin = vmaxmin;
1185                  if (st->log2GR < 0) {
1186                          for (n = 0; n < 8; n += 2) {
1187                                  float   v = SDgetTreMin(st->u.t[n]);
# Line 1196 | Line 1197 | subtract_min_Y(SDNode *st)
1197          } else                          /* anisotropic covers entire tree */
1198                  vmin = SDgetTreMin(st);
1199  
1200 <        if (vmin <= .01/M_PI)
1200 >        if ((vmin >= vmaxmin) | (vmin <= .01/M_PI))
1201                  return .0;              /* not worth bothering about */
1202  
1203          SDsubtractTreVal(st, vmin);
# Line 1318 | Line 1319 | subtract_min_RGB(C_COLOR *cs, SDNode *stc[])
1319          SDtraverseTre(stc[tt_Y], NULL, 0, get_min_RGB, &my_min);
1320                                          /* convert to C_COLOR */
1321          ymin =  c_fromSharpRGB(my_min.rgb, cs);
1322 <        if (ymin <= .01/M_PI)           /* not worth bothering about? */
1323 <                return .0;
1322 >        if ((ymin >= .5*FHUGE) | (ymin <= .01/M_PI))
1323 >                return .0;              /* close to zero or no tree */
1324                                          /* adjust u' & v' trees */
1325          SDtraverseTre(stc[tt_u], NULL, 0, adjust_utree, &my_min);
1326          SDtraverseTre(stc[tt_v], NULL, 0, adjust_vtree, &my_min);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines