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.43 by greg, Tue Apr 19 01:15:06 2005 UTC vs.
Revision 2.45 by greg, Sun Sep 26 15:51:15 2010 UTC

# Line 167 | Line 167 | diraniso(              /* compute source contribution */
167                  } else
168                          dtmp = 0.0;
169                                                  /* gaussian */
170 <                dtmp = exp(-dtmp) / (PI * np->pdot * sqrt(au2*av2));
170 >                dtmp = exp(-dtmp) * (1.0/PI) * sqrt(-ldot/(np->pdot*au2*av2));
171                                                  /* worth using? */
172                  if (dtmp > FTINY) {
173                          copycolor(ctmp, np->mcolor);
# Line 214 | Line 214 | m_aniso(                       /* shade ray that hit something anisotropic
214          nd.specfl = 0;
215          nd.u_alpha = m->oargs.farg[4];
216          nd.v_alpha = m->oargs.farg[5];
217 <        if (nd.u_alpha < FTINY || nd.v_alpha <= FTINY)
217 >        if (nd.u_alpha <= FTINY || nd.v_alpha <= FTINY)
218                  objerror(m, USER, "roughness too small");
219  
220          nd.pdot = raynormal(nd.pnorm, r);       /* perturb normal */
# Line 380 | Line 380 | agaussamp(             /* sample anisotropic gaussian specular */
380                          for (i = 0; i < 3; i++)
381                                  sr.rdir[i] = r->rdir[i] + d*h[i];
382                          if (DOT(sr.rdir, r->ron) > FTINY) {
383 +                                checknorm(sr.rdir);
384                                  rayvalue(&sr);
385                                  multcolor(sr.rcol, sr.rcoef);
386                                  addcolor(r->rcol, sr.rcol);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines