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.61 by greg, Thu Jul 9 17:32:31 2020 UTC vs.
Revision 2.63 by greg, Sat Mar 27 20:08:58 2021 UTC

# Line 195 | Line 195 | compute_through(BSDFDAT *ndp)
195          }
196          if (vypeak*tomsurr < peak_over*bright(vsurr)*ns)
197                  return;                         /* peak not peaky enough */
198 <        if ((vypeak/ns - ndp->sd->tLamb.cieY*(1./PI))*tomsum <= .001)
198 >        if ((vypeak/ns - (ndp->vray[2] > 0 ? ndp->sd->tLambFront.cieY
199 >                        : ndp->sd->tLambBack.cieY)*(1./PI))*tomsum <= .001)
200                  return;                         /* < 0.1% transmission */
201          copycolor(ndp->cthru, vpeak);           /* already scaled by omega */
202          multcolor(ndp->cthru, ndp->pr->pcol);   /* modify by pattern */
# Line 255 | Line 256 | direct_specular_OK(COLOR cval, FVECT ldir, double omeg
256                          return(0);      /* all diffuse */
257                  sv = ndp->sd->rLambBack;
258                  break;
259 <        default:
259 >        case 1:
260                  if ((ndp->sd->tf == NULL) & (ndp->sd->tb == NULL))
261                          return(0);      /* all diffuse */
262 <                sv = ndp->sd->tLamb;
262 >                sv = ndp->sd->tLambFront;
263                  break;
264 +        case 2:
265 +                if ((ndp->sd->tf == NULL) & (ndp->sd->tb == NULL))
266 +                        return(0);      /* all diffuse */
267 +                sv = ndp->sd->tLambBack;
268 +                break;
269          }
270          if (sv.cieY > FTINY) {
271                  diffY = sv.cieY *= 1./PI;
# Line 677 | Line 683 | m_bsdf(OBJREC *m, RAY *r)
683                  SDfreeCache(nd.sd);
684                  return(1);
685          }
686 <                                                /* diffuse reflectance */
686 >                                                /* diffuse components */
687          if (hitfront) {
688                  cvt_sdcolor(nd.rdiff, &nd.sd->rLambFront);
689                  if (m->oargs.nfargs >= 3) {
# Line 686 | Line 692 | m_bsdf(OBJREC *m, RAY *r)
692                                          m->oargs.farg[2]);
693                          addcolor(nd.rdiff, ctmp);
694                  }
695 +                cvt_sdcolor(nd.tdiff, &nd.sd->tLambFront);
696          } else {
697                  cvt_sdcolor(nd.rdiff, &nd.sd->rLambBack);
698                  if (m->oargs.nfargs >= 6) {
# Line 694 | Line 701 | m_bsdf(OBJREC *m, RAY *r)
701                                          m->oargs.farg[5]);
702                          addcolor(nd.rdiff, ctmp);
703                  }
704 +                cvt_sdcolor(nd.tdiff, &nd.sd->tLambBack);
705          }
706 <                                                /* diffuse transmittance */
699 <        cvt_sdcolor(nd.tdiff, &nd.sd->tLamb);
700 <        if (m->oargs.nfargs >= 9) {
706 >        if (m->oargs.nfargs >= 9) {             /* add diffuse transmittance? */
707                  setcolor(ctmp, m->oargs.farg[6],
708                                  m->oargs.farg[7],
709                                  m->oargs.farg[8]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines