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

Comparing ray/src/rt/normal.c (file contents):
Revision 2.19 by greg, Sat May 16 08:37:06 1992 UTC vs.
Revision 2.22 by greg, Fri Oct 16 10:20:29 1992 UTC

# Line 24 | Line 24 | extern double  specthresh;             /* specular sampling thres
24   extern double  specjitter;              /* specular sampling jitter */
25  
26   /*
27 < *      This routine uses portions of the reflection
28 < *  model described by Cook and Torrance.
29 < *      The computation of specular components has been simplified by
30 < *  numerous approximations and ommisions to improve speed.
27 > *      This routine implements the isotropic Gaussian
28 > *  model described by Ward in Siggraph `92 article.
29   *      We orient the surface towards the incoming ray, so a single
30   *  surface can be used to represent an infinitely thin object.
31   *
# Line 137 | Line 135 | double  omega;                 /* light source size */
135                                                  /* roughness + source */
136                  dtmp = np->alpha2 + omega/PI;
137                                                  /* gaussian */
138 <                dtmp = exp((2.*DOT(np->prdir,ldir)-2.)/dtmp)/(4.*PI*dtmp);
138 >                dtmp = exp((2.*DOT(np->prdir,ldir)-2.)/dtmp)/(PI*dtmp);
139                                                  /* worth using? */
140                  if (dtmp > FTINY) {
141                          copycolor(ctmp, np->mcolor);
# Line 369 | Line 367 | register NORMDAT  *np;
367                  if (rv[1] <= FTINY)
368                          d = 1.0;
369                  else
370 <                        d = sqrt( np->alpha2/4.0 * -log(rv[1]) );
370 >                        d = sqrt( -log(rv[1]) * np->alpha2 );
371                  for (i = 0; i < 3; i++)
372                          sr.rdir[i] = np->prdir[i] + d*(cosp*u[i] + sinp*v[i]);
373                  if (DOT(sr.rdir, r->ron) < -FTINY)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines