ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/m_brdf.c
(Generate patch)

Comparing ray/src/rt/m_brdf.c (file contents):
Revision 2.36 by greg, Tue Nov 13 19:58:33 2018 UTC vs.
Revision 2.38 by greg, Wed Feb 13 02:38:26 2019 UTC

# Line 284 | Line 284 | m_brdf(                        /* color a ray that hit a BRDTfunc material
284                  rayvalue(&sr);
285                  multcolor(sr.rcol, sr.rcoef);
286                  addcolor(r->rcol, sr.rcol);
287 <                if (!hastexture || r->crtype & (SHADOW|AMBIENT))
287 >                if ((!hastexture || r->crtype & (SHADOW|AMBIENT)) &&
288 >                                nd.tspec > bright(nd.tdiff) + bright(nd.rdiff))
289                          r->rxt = r->rot + raydistance(&sr);
290          }
291          if (r->crtype & SHADOW)                 /* the rest is shadow */
# Line 407 | Line 408 | m_brdf2(                       /* color a ray that hit a BRDF material */
408                  multambient(ctmp, r, nd.pnorm);
409                  addcolor(r->rcol, ctmp);        /* add to returned color */
410          }
411 <        if (nd.trans > FTINY) {         /* from other side */
411 >        if (nd.trans > FTINY) {                 /* from other side */
412                  flipsurface(r);
413                  vtmp[0] = -nd.pnorm[0];
414                  vtmp[1] = -nd.pnorm[1];
# Line 436 | Line 437 | setbrdfunc(                    /* set up brdf function and variables */
437                  return(0);      /* it's OK, setfunc says we're done */
438                                  /* else (re)assign special variables */
439          multv3(vec, np->pnorm, funcxf.xfm);
440 <        varset("NxP", '=', vec[0]/funcxf.sca);
441 <        varset("NyP", '=', vec[1]/funcxf.sca);
442 <        varset("NzP", '=', vec[2]/funcxf.sca);
443 <        varset("RdotP", '=', np->pdot <= -1.0 ? -1.0 :
440 >        varset("NxP`", '=', vec[0]/funcxf.sca);
441 >        varset("NyP`", '=', vec[1]/funcxf.sca);
442 >        varset("NzP`", '=', vec[2]/funcxf.sca);
443 >        varset("RdotP`", '=', np->pdot <= -1.0 ? -1.0 :
444                          np->pdot >= 1.0 ? 1.0 : np->pdot);
445          varset("CrP", '=', colval(np->mcolor,RED));
446          varset("CgP", '=', colval(np->mcolor,GRN));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines