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.3 by rschregle, Fri May 8 13:20:23 2015 UTC vs.
Revision 2.4 by greg, Wed May 20 15:59:44 2015 UTC

# Line 199 | Line 199 | static int isoSpecPhotonScatter (NORMDAT *nd, RAY *ray
199     int      niter, i = 0;
200    
201     /* Set up sample coordinates */  
202 <   do {
203 <      v [0] = v [1] = v [2] = 0;
204 <      v [i++] = 1;
205 <      fcross(u, v, nd -> pnorm);
206 <   } while (normalize(u) < FTINY);
207 <  
202 >   getperpendicular(u, nd -> pnorm);  
203     fcross(v, nd -> pnorm, u);
204    
205     if (nd -> specfl & SP_REFL) {
# Line 268 | Line 263 | static void diffPhotonScatter (FVECT normal, RAY* rayO
263     int         i = 0;
264  
265     /* Set up sample coordinates */
266 <   do {
272 <      v [0] = v [1] = v [2] = 0;
273 <      v [i++] = 1;
274 <      fcross(u, v, normal);
275 <   } while (normalize(u) < FTINY);
276 <  
266 >   getperpendicular(u, normal);
267     fcross(v, normal, u);
268    
269     /* Convert theta & phi to cartesian */
# Line 324 | Line 314 | static int normalPhotonScatter (OBJREC *mat, RAY *rayI
314        nd.specfl |= SP_FLAT;  
315        
316     /* Perturb normal */
317 <   if ((hastexture = DOT(rayIn -> pert, rayIn -> pert)) > sqr(FTINY))
317 >   if ((hastexture = (DOT(rayIn -> pert, rayIn -> pert) > sqr(FTINY)) ))
318        nd.pdot = raynormal(nd.pnorm, rayIn);
319     else {
320        VCOPY(nd.pnorm, rayIn -> ron);
# Line 753 | Line 743 | static int dielectricPhotonScatter (OBJREC *mat, RAY *
743     /* get modifiers */
744     raytexture(rayIn, mat -> omod);                      
745    
746 <   if ((hastexture = DOT(rayIn -> pert, rayIn -> pert)) > FTINY * FTINY)
746 >   if ((hastexture = (DOT(rayIn -> pert, rayIn -> pert) > FTINY * FTINY)))
747        /* Perturb normal */
748        cos1 = raynormal(dnorm, rayIn);
749     else {
# Line 900 | Line 890 | static int glassPhotonScatter (OBJREC *mat, RAY *rayIn
890     /* reorient if necessary */
891     if (rayIn -> rod < 0)
892        flipsurface(rayIn);
893 <   if ((hastexture = DOT(rayIn -> pert, rayIn -> pert)) > FTINY * FTINY)
893 >   if ((hastexture = (DOT(rayIn -> pert, rayIn -> pert) > FTINY * FTINY) ))
894        pdot = raynormal(pnorm, rayIn);
895     else {
896        VCOPY(pnorm, rayIn -> ron);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines