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.47 by greg, Mon Feb 12 23:20:31 2018 UTC vs.
Revision 2.49 by greg, Sat May 12 02:32:10 2018 UTC

# Line 490 | Line 490 | sample_sdcomp(BSDFDAT *ndp, SDComponent *dcp, int xmit
490                  if (xmit)                       /* apply pattern on transmit */
491                          multcolor(sr.rcoef, ndp->pr->pcol);
492                  if (rayorigin(&sr, SPECULAR, ndp->pr, sr.rcoef) < 0) {
493 <                        if (maxdepth > 0)
494 <                                break;
495 <                        continue;               /* Russian roulette victim */
493 >                        if (!n & (nstarget > 1)) {
494 >                                n = nstarget;   /* avoid infinitue loop */
495 >                                nstarget = nstarget*sr.rweight/minweight;
496 >                                if (n == nstarget) break;
497 >                                n = -1;         /* moved target */
498 >                        }
499 >                        continue;               /* try again */
500                  }
501                  if (xmit && ndp->thick != 0)    /* need to offset origin? */
502                          VSUM(sr.rorg, sr.rorg, ndp->pr->ron, -ndp->thick);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines