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

Comparing ray/src/rt/aniso.c (file contents):
Revision 2.57 by greg, Thu Dec 4 05:26:28 2014 UTC vs.
Revision 2.60 by greg, Tue May 26 13:21:07 2015 UTC

# Line 97 | Line 97 | diraniso(              /* compute source contribution */
97                  scalecolor(ctmp, dtmp);
98                  addcolor(cval, ctmp);
99          }
100 +
101 +        if ((ldot < -FTINY) & (np->tdiff > FTINY)) {
102 +                /*
103 +                 *  Compute diffuse transmission.
104 +                 */
105 +                copycolor(ctmp, np->mcolor);
106 +                dtmp = -ldot * omega * np->tdiff * (1.0/PI);
107 +                scalecolor(ctmp, dtmp);
108 +                addcolor(cval, ctmp);
109 +        }
110 +        
111          if (ldot > FTINY && np->specfl&SP_REFL) {
112                  /*
113                   *  Compute specular reflection coefficient using
# Line 130 | Line 141 | diraniso(              /* compute source contribution */
141                          addcolor(cval, ctmp);
142                  }
143          }
144 <        if ((ldot < -FTINY) & (np->tdiff > FTINY)) {
134 <                /*
135 <                 *  Compute diffuse transmission.
136 <                 */
137 <                copycolor(ctmp, np->mcolor);
138 <                dtmp = -ldot * omega * np->tdiff * (1.0/PI);
139 <                scalecolor(ctmp, dtmp);
140 <                addcolor(cval, ctmp);
141 <        }
144 >        
145          if (ldot < -FTINY && np->specfl&SP_TRAN) {
146                  /*
147                   *  Compute specular transmission.  Specular transmission
# Line 278 | Line 281 | m_aniso(                       /* shade ray that hit something anisotropic
281                  multambient(ctmp, r, nd.pnorm);
282                  addcolor(r->rcol, ctmp);        /* add to returned color */
283          }
284 +        
285          if (nd.tdiff > FTINY) {         /* ambient from other side */
286                  FVECT  bnorm;
287  
# Line 300 | Line 304 | m_aniso(                       /* shade ray that hit something anisotropic
304          return(1);
305   }
306  
303
307   static void
308   getacoords(             /* set up coordinate system */
309          ANISODAT  *np
# Line 322 | Line 325 | getacoords(            /* set up coordinate system */
325          if (normalize(np->v) == 0.0) {
326                  if (fabs(np->u_alpha - np->v_alpha) > 0.001)
327                          objerror(np->mp, WARNING, "illegal orientation vector");
328 <                getperpendicular(np->u, np->pnorm);     /* punting */
328 >                getperpendicular(np->u, np->pnorm, 1);  /* punting */
329                  fcross(np->v, np->pnorm, np->u);
330                  np->u_alpha = np->v_alpha = sqrt( 0.5 *
331                          (np->u_alpha*np->u_alpha + np->v_alpha*np->v_alpha) );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines