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

Comparing ray/src/cv/bsdfmesh.c (file contents):
Revision 2.38 by greg, Tue May 16 20:41:03 2017 UTC vs.
Revision 2.39 by greg, Fri Oct 6 00:23:09 2017 UTC

# Line 63 | Line 63 | eval_DSFsurround(const RBFNODE *rbf, const FVECT outve
63   static double
64   est_DSFrad(const RBFNODE *rbf, const FVECT outvec)
65   {
66 <        const double    rad_epsilon = 0.03;
66 >        const double    rad_epsilon = 0.01;
67          const double    DSFtarget = 0.60653066 * eval_rbfrep(rbf,outvec) *
68                                                          COSF(outvec[2]);
69          double          inside_rad = rad_epsilon;
# Line 76 | Line 76 | est_DSFrad(const RBFNODE *rbf, const FVECT outvec)
76          do {
77                  double  test_rad = interp_rad;
78                  double  DSFtest;
79 <                if (test_rad >= outside_rad)
80 <                        return(test_rad);
81 <                if (test_rad <= inside_rad)
82 <                        return(test_rad*(test_rad>0));
79 >                if ((test_rad >= outside_rad) | (test_rad <= inside_rad))
80 >                        test_rad = .5*(inside_rad + outside_rad);
81                  DSFtest = eval_DSFsurround(rbf, outvec, test_rad);
82                  if (DSFtest > DSFtarget) {
83                          inside_rad = test_rad;
# Line 88 | Line 86 | est_DSFrad(const RBFNODE *rbf, const FVECT outvec)
86                          outside_rad = test_rad;
87                          DSFoutside = DSFtest;
88                  }
91                if (DSFoutside >= DSFinside)
92                        return(test_rad);
89          } while (outside_rad-inside_rad > rad_epsilon);
90 <        return(interp_rad);
90 >
91 >        return(.5*(inside_rad + outside_rad));
92   #undef interp_rad
93   }
94  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines