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.2 by rschregle, Wed Apr 22 15:50:44 2015 UTC vs.
Revision 2.5 by greg, Thu May 21 05:54:54 2015 UTC

# Line 4 | Line 4
4  
5     Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
6     (c) Fraunhofer Institute for Solar Energy Systems,
7 <       Lucerne University of Applied Sciences & Arts
7 >   (c) Lucerne University of Applied Sciences and Arts,
8 >   supported by the Swiss National Science Foundation (SNSF, #147053)
9     ==================================================================
10    
11     $Id$
# Line 198 | Line 199 | static int isoSpecPhotonScatter (NORMDAT *nd, RAY *ray
199     int      niter, i = 0;
200    
201     /* Set up sample coordinates */  
202 <   do {
202 <      v [0] = v [1] = v [2] = 0;
203 <      v [i++] = 1;
204 <      fcross(u, v, nd -> pnorm);
205 <   } while (normalize(u) < FTINY);
206 <  
202 >   getperpendicular(u, nd -> pnorm, 1);  
203     fcross(v, nd -> pnorm, u);
204    
205     if (nd -> specfl & SP_REFL) {
# Line 267 | Line 263 | static void diffPhotonScatter (FVECT normal, RAY* rayO
263     int         i = 0;
264  
265     /* Set up sample coordinates */
266 <   do {
271 <      v [0] = v [1] = v [2] = 0;
272 <      v [i++] = 1;
273 <      fcross(u, v, normal);
274 <   } while (normalize(u) < FTINY);
275 <  
266 >   getperpendicular(u, normal, 1);
267     fcross(v, normal, u);
268    
269     /* Convert theta & phi to cartesian */
# Line 323 | 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 752 | 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 899 | 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);
# Line 1658 | Line 1649 | static int pattexPhotonScatter (OBJREC *mat, RAY *rayI
1649        return 0;
1650     }
1651   #else
1652 +
1653 + /*
1654 +   The following code is
1655 +   (c) Lucerne University of Applied Sciences and Arts,
1656 +   supported by the Swiss National Science Foundation (SNSF, #147053)
1657 + */  
1658  
1659   static int bsdfPhotonScatter (OBJREC *mat, RAY *rayIn)
1660   /* Generate new photon ray for BSDF modifier and recurse. */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines