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.69 by greg, Tue Mar 8 22:27:56 2022 UTC vs.
Revision 2.70 by greg, Wed Mar 9 00:27:25 2022 UTC

# Line 251 | Line 251 | direct_specular_OK(COLOR cval, FVECT ldir, double omeg
251                                          /* transform source direction */
252          if (SDmapDir(vsrc, ndp->toloc, ldir) != SDEnone)
253                  return(0);
254 +                                        /* check indirect over-counting */
255 +        if ((vsrc[2] > 0) ^ (ndp->vray[2] > 0) && bright(ndp->cthru) > FTINY) {
256 +                double          dx = vsrc[0] + ndp->vray[0];
257 +                double          dy = vsrc[1] + ndp->vray[1];
258 +                SDSpectralDF    *dfp = (ndp->pr->rod > 0) ?
259 +                        ((ndp->sd->tf != NULL) ? ndp->sd->tf : ndp->sd->tb) :
260 +                        ((ndp->sd->tb != NULL) ? ndp->sd->tb : ndp->sd->tf) ;
261 +
262 +                tomega = omega*fabs(vsrc[2]);
263 +                if (dx*dx + dy*dy <= (2.5*4./PI)*(tomega + dfp->minProjSA +
264 +                                                2.*sqrt(tomega*dfp->minProjSA))) {
265 +                        if (bright(ndp->cthru_surr) <= FTINY)
266 +                                return(0);
267 +                        copycolor(cval, ndp->cthru_surr);
268 +                        return(1);      /* return non-zero surround BTDF */
269 +                }
270 +        }
271                                          /* will discount diffuse portion */
272          switch ((vsrc[2] > 0)<<1 | (ndp->vray[2] > 0)) {
273          case 3:
# Line 280 | Line 297 | direct_specular_OK(COLOR cval, FVECT ldir, double omeg
297          } else {
298                  diffY = 0;
299                  setcolor(cdiff,  0, 0, 0);
283        }
284                                        /* check indirect over-counting */
285        if ((vsrc[2] > 0) ^ (ndp->vray[2] > 0) && bright(ndp->cthru) > FTINY) {
286                double          dx = vsrc[0] + ndp->vray[0];
287                double          dy = vsrc[1] + ndp->vray[1];
288                SDSpectralDF    *dfp = (ndp->pr->rod > 0) ?
289                        ((ndp->sd->tf != NULL) ? ndp->sd->tf : ndp->sd->tb) :
290                        ((ndp->sd->tb != NULL) ? ndp->sd->tb : ndp->sd->tf) ;
291
292                tomega = omega*fabs(vsrc[2]);
293                if (dx*dx + dy*dy <= (2.5*4./PI)*(tomega + dfp->minProjSA +
294                                                2.*sqrt(tomega*dfp->minProjSA))) {
295                        if (bright(ndp->cthru_surr) <= FTINY)
296                                return(0);
297                        copycolor(cval, ndp->cthru_surr);
298                        return(1);      /* return non-zero surround BTDF */
299                }
300          }
301          ec = SDsizeBSDF(&tomega, ndp->vray, vsrc, SDqueryMin, ndp->sd);
302          if (ec)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines