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.71 by greg, Wed Nov 15 18:02:52 2023 UTC vs.
Revision 2.72 by greg, Fri Apr 5 01:10:26 2024 UTC

# Line 531 | Line 531 | sample_sdcomp(BSDFDAT *ndp, SDComponent *dcp, int xmit
531                  cvt_sdcolor(sr.rcoef, &bsv);    /* use sample color */
532                  if (xmit)                       /* apply pattern on transmit */
533                          smultscolor(sr.rcoef, ndp->pr->pcol);
534 <                if (rayorigin(&sr, SPECULAR, ndp->pr, sr.rcoef) < 0) {
534 >                if (rayorigin(&sr, xmit ? TSPECULAR : RSPECULAR, ndp->pr, sr.rcoef) < 0) {
535                          if (!n & (nstarget > 1)) {
536                                  n = nstarget;   /* avoid infinitue loop */
537                                  nstarget = nstarget*sr.rweight/minweight;
# Line 766 | Line 766 | m_bsdf(OBJREC *m, RAY *r)
766          copyscolor(sctmp, nd.rdiff);
767          saddscolor(sctmp, nd.runsamp);
768          if (sintens(sctmp) > FTINY) {           /* ambient from reflection */
769                if (!hitfront)
770                        flipsurface(r);
769                  multambient(sctmp, r, nd.pnorm);
770                  saddscolor(r->rcol, sctmp);
773                if (!hitfront)
774                        flipsurface(r);
771          }
772          copyscolor(sctmp, nd.tdiff);
773          saddscolor(sctmp, nd.tunsamp);
774          if (sintens(sctmp) > FTINY) {           /* ambient from other side */
775                  FVECT  bnorm;
780                if (hitfront)
781                        flipsurface(r);
776                  bnorm[0] = -nd.pnorm[0];
777                  bnorm[1] = -nd.pnorm[1];
778                  bnorm[2] = -nd.pnorm[2];
# Line 790 | Line 784 | m_bsdf(OBJREC *m, RAY *r)
784                  } else
785                          multambient(sctmp, r, bnorm);
786                  saddscolor(r->rcol, sctmp);
793                if (hitfront)
794                        flipsurface(r);
787          }
788                                                  /* add direct component */
789          if ((nd.sd->tf == NULL) & (nd.sd->tb == NULL) &&

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines