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

Comparing ray/src/rt/m_bsdf.c (file contents):
Revision 2.13 by greg, Sun Aug 21 21:24:30 2011 UTC vs.
Revision 2.14 by greg, Sun Aug 21 22:38:12 2011 UTC

# Line 100 | Line 100 | bsdf_jitter(FVECT vres, BSDFDAT *ndp, int domax)
100   static int
101   direct_bsdf_OK(COLOR cval, FVECT ldir, double omega, BSDFDAT *ndp)
102   {
103 <        int     nsamp, ok = 0;
103 >        int     nsamp = 1, ok = 0;
104          FVECT   vsrc, vsmp, vjit;
105          double  tomega;
106          double  sf, sd[2];
# Line 119 | Line 119 | direct_bsdf_OK(COLOR cval, FVECT ldir, double omega, B
119                  if (dx*dx + dy*dy <= omega*(1./PI))
120                          return(0);
121          }
122 <                                        /* get local BSDF resolution */
123 <        ec = SDsizeBSDF(&tomega, ndp->vray, vsrc, SDqueryMin, ndp->sd);
124 <        if (ec)
125 <                goto baderror;
126 <                                        /* assign number of samples */
127 <        if (tomega <= omega*.02)
128 <                nsamp = 50;
129 <        else
130 <                nsamp = 2.*omega/tomega + 1.;
122 >        if (specjitter > FTINY) {       /* assign number of samples */
123 >                ec = SDsizeBSDF(&tomega, ndp->vray, vsrc, SDqueryMin, ndp->sd);
124 >                if (ec)
125 >                        goto baderror;
126 >                sf = specjitter * ndp->pr->rweight;
127 >                if (tomega <= omega*.01)
128 >                        nsamp = 100.*sf + .5;
129 >                else
130 >                        nsamp = 4.*sf*omega/tomega + .5;
131 >                nsamp += !nsamp;
132 >        }
133          sf = sqrt(omega);
134          setcolor(cval, .0, .0, .0);     /* sample our source area */
135          for (i = nsamp; i--; ) {
# Line 327 | Line 329 | sample_sdcomp(BSDFDAT *ndp, SDComponent *dcp, int usep
329                                                  /* multiple samples? */
330          if (specjitter > 1.5) {
331                  nstarget = specjitter*ndp->pr->rweight + .5;
332 <                if (nstarget < 1)
331 <                        nstarget = 1;
332 >                nstarget += !nstarget;
333          }
334                                                  /* run through our samples */
335          for (nsent = 0; nsent < nstarget; nsent++) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines