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.74 by greg, Wed Sep 18 19:52:35 2024 UTC vs.
Revision 2.75 by greg, Fri Dec 13 19:05:03 2024 UTC

# Line 626 | Line 626 | sample_sdf(BSDFDAT *ndp, int sflags)
626   int
627   m_bsdf(OBJREC *m, RAY *r)
628   {
629 <        int     hasthick = (m->otype == MAT_BSDF);
630 <        int     hitfront;
629 >        const int       hasthick = (m->otype == MAT_BSDF);
630 >        const int       hitfront = (r->rod > 0);
631          SCOLOR  sctmp;
632          SDError ec;
633          FVECT   upvec, vtmp;
634          MFUNC   *mf;
635          BSDFDAT nd;
636 +                                                /* check backface visibility */
637 +        if (!hitfront & !backvis) {
638 +                raytrans(r);
639 +                return(1);
640 +        }
641                                                  /* check arguments */
642          if ((m->oargs.nsargs < hasthick+5) | (m->oargs.nfargs > 9) |
643                                  (m->oargs.nfargs % 3))
644                  objerror(m, USER, "bad # arguments");
640                                                /* record surface struck */
641        hitfront = (r->rod > 0);
645                                                  /* load cal file */
646          mf = hasthick   ? getfunc(m, 5, 0x1d, 1)
647                          : getfunc(m, 4, 0xe, 1) ;
# Line 648 | Line 651 | m_bsdf(OBJREC *m, RAY *r)
651                  nd.thick = evalue(mf->ep[0]);
652                  if ((-FTINY <= nd.thick) & (nd.thick <= FTINY))
653                          nd.thick = 0;
651        }
652                                                /* check backface visibility */
653        if (!hitfront & !backvis) {
654                raytrans(r);
655                return(1);
654          }
655                                                  /* check other rays to pass */
656          if (nd.thick != 0 && (r->crtype & SHADOW ||

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines