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

Comparing ray/src/rt/pmapmat.c (file contents):
Revision 2.24 by rschregle, Mon Feb 22 13:27:49 2021 UTC vs.
Revision 2.26 by greg, Thu Dec 19 23:25:28 2024 UTC

# Line 335 | Line 335 | static int normalPhotonScatter (OBJREC *mat, RAY *rayI
335     if ((nd.alpha2 *= nd.alpha2) <= FTINY)
336        nd.specfl |= SP_PURE;
337        
338   if (rayIn -> ro != NULL && isflat(rayIn -> ro -> otype))
339      nd.specfl |= SP_FLAT;  
340      
338     /* Perturb normal */
339     if ((hastexture = (DOT(rayIn -> pert, rayIn -> pert) > sqr(FTINY)) ))
340        nd.pdot = raynormal(nd.pnorm, rayIn);
# Line 346 | Line 343 | static int normalPhotonScatter (OBJREC *mat, RAY *rayI
343        nd.pdot = rayIn -> rod;
344     }
345    
346 <   nd.pdot = max(nd.pdot, .001);
346 >    if (!hastexture && rayIn -> ro != NULL && isflat(rayIn -> ro -> otype))
347 >      nd.specfl |= SP_FLAT;
348 >
349 >  nd.pdot = max(nd.pdot, .001);
350        
351     /* Modify material color */
352     multcolor(nd.mcolor, rayIn -> pcol);
# Line 497 | Line 497 | static void getacoords (ANISODAT *nd)
497     for (i = 0; i < 3; i++)
498        nd -> u [i] = evalue(mf -> ep [i]);
499    
500 <   if (errno == EDOM || errno == ERANGE)
500 >   if ((errno == EDOM) | (errno == ERANGE))
501        nd -> u [0] = nd -> u [1] = nd -> u [2] = 0.0;
502        
503     if (mf -> fxp != &unitxf)
# Line 1546 | Line 1546 | static int brdfPhotonScatter (OBJREC *mat, RAY *rayIn)
1546              evalue(mf->ep[0]), evalue(mf->ep[1]), evalue(mf->ep[2]));
1547     setcolor(tspecCol,
1548              evalue(mf->ep[3]), evalue(mf->ep[4]), evalue(mf->ep[5]));
1549 <   if (errno == EDOM || errno == ERANGE)
1549 >   if ((errno == EDOM) | (errno == ERANGE))
1550        objerror(mat, WARNING, "compute error");
1551     else {
1552        /* Set up probz */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines