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.22 by greg, Sun Sep 2 15:33:15 2012 UTC vs.
Revision 2.28 by greg, Tue May 26 13:21:07 2015 UTC

# Line 122 | Line 122 | direct_bsdf_OK(COLOR cval, FVECT ldir, double omega, B
122                          return(0);
123          }
124          sf = specjitter * ndp->pr->rweight;
125 <        if (25.*tomega <= omega)
125 >        if (tomega <= .0)
126 >                nsamp = 1;
127 >        else if (25.*tomega <= omega)
128                  nsamp = 100.*sf + .5;
129          else
130                  nsamp = 4.*sf*omega/tomega + .5;
# Line 444 | Line 446 | m_bsdf(OBJREC *m, RAY *r)
446          hitfront = (r->rod > 0);
447                                                  /* load cal file */
448          mf = getfunc(m, 5, 0x1d, 1);
449 +        setfunc(m, r);
450                                                  /* get thickness */
451          nd.thick = evalue(mf->ep[0]);
452          if ((-FTINY <= nd.thick) & (nd.thick <= FTINY))
# Line 454 | Line 457 | m_bsdf(OBJREC *m, RAY *r)
457                          raytrans(r);            /* pass-through */
458                  return(1);                      /* or shadow */
459          }
460 +                                                /* check backface visibility */
461 +        if (!hitfront & !backvis) {
462 +                raytrans(r);
463 +                return(1);
464 +        }
465                                                  /* check other rays to pass */
466          if (nd.thick != 0 && (!(r->crtype & (SPECULAR|AMBIENT)) ||
467                                  nd.thick > 0 ^ hitfront)) {
# Line 471 | Line 479 | m_bsdf(OBJREC *m, RAY *r)
479                                          m->oargs.farg[1],
480                                          m->oargs.farg[2]);
481          } else {
482 <                if (m->oargs.nfargs < 6) {      /* check invisible backside */
475 <                        if (!backvis && (nd.sd->rb == NULL) &
476 <                                        (nd.sd->tb == NULL)) {
477 <                                SDfreeCache(nd.sd);
478 <                                raytrans(r);
479 <                                return(1);
480 <                        }
482 >                if (m->oargs.nfargs < 6)
483                          setcolor(nd.rdiff, .0, .0, .0);
484 <                } else
484 >                else
485                          setcolor(nd.rdiff, m->oargs.farg[3],
486                                          m->oargs.farg[4],
487                                          m->oargs.farg[5]);
# Line 506 | Line 508 | m_bsdf(OBJREC *m, RAY *r)
508          if (mf->fxp != &unitxf) {
509                  multv3(upvec, upvec, mf->fxp->xfm);
510                  nd.thick *= mf->fxp->sca;
511 +        }
512 +        if (r->rox != NULL) {
513 +                multv3(upvec, upvec, r->rox->f.xfm);
514 +                nd.thick *= r->rox->f.sca;
515          }
516          raynormal(nd.pnorm, r);
517                                                  /* compute local BSDF xform */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines