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.50 by greg, Tue Apr 19 01:15:06 2005 UTC vs.
Revision 2.51 by greg, Thu Dec 8 17:56:38 2005 UTC

# Line 25 | Line 25 | static const char RCSid[] = "$Id$";
25   #endif
26                                          /* estimate of Fresnel function */
27   #define  FRESNE(ci)     (exp(-5.85*(ci)) - 0.00287989916)
28 + #define  FRESTHRESH     0.017999        /* minimum specularity for approx. */
29  
30  
31   /*
# Line 93 | Line 94 | dirnorm(               /* compute source contribution */
94                                  /* Fresnel estimate */
95          lrdiff = np->rdiff;
96          ltdiff = np->tdiff;
97 <        if (np->specfl & SP_PURE && np->rspec > FTINY &&
97 >        if (np->specfl & SP_PURE && np->rspec >= FRESTHRESH &&
98                          (lrdiff > FTINY) | (ltdiff > FTINY)) {
99                  dtmp = 1. - FRESNE(fabs(ldot));
100                  lrdiff *= dtmp;
# Line 225 | Line 226 | m_normal(                      /* color a ray that hit something normal *
226          mirdist = transdist = r->rot;
227          nd.rspec = m->oargs.farg[3];
228                                                  /* compute Fresnel approx. */
229 <        if (nd.specfl & SP_PURE && nd.rspec > FTINY) {
229 >        if (nd.specfl & SP_PURE && nd.rspec >= FRESTHRESH) {
230                  fest = FRESNE(r->rod);
231                  nd.rspec += fest*(1. - nd.rspec);
232          } else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines