--- ray/src/rt/normal.c 2003/06/17 21:32:46 2.43 +++ ray/src/rt/normal.c 2003/08/28 03:22:16 2.46 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: normal.c,v 2.43 2003/06/17 21:32:46 greg Exp $"; +static const char RCSid[] = "$Id: normal.c,v 2.46 2003/08/28 03:22:16 greg Exp $"; #endif /* * normal.c - shading function for normal materials. @@ -15,6 +15,8 @@ static const char RCSid[] = "$Id: normal.c,v 2.43 2003 #include "ray.h" +#include "ambient.h" + #include "otypes.h" #include "random.h" @@ -23,7 +25,7 @@ static const char RCSid[] = "$Id: normal.c,v 2.43 2003 #define MAXITER 10 /* maximum # specular ray attempts */ #endif /* estimate of Fresnel function */ -#define FRESNE(ci) (exp(-6.5*(ci)) - 0.00150343919) +#define FRESNE(ci) (exp(-5.85*(ci)) - 0.00287989916) static void gaussamp(); @@ -87,7 +89,7 @@ double omega; /* light source size */ /* Fresnel estimate */ ldiff = np->rdiff; - if (np->specfl & SP_PURE && (np->rspec > FTINY & ldiff > FTINY)) + if (np->specfl & SP_PURE && (np->rspec > FTINY) & (ldiff > FTINY)) ldiff *= 1. - FRESNE(fabs(ldot)); if (ldot > FTINY && ldiff > FTINY) { @@ -198,7 +200,7 @@ register RAY *r; if ((nd.alpha2 *= nd.alpha2) <= FTINY) nd.specfl |= SP_PURE; - if (hastexture = (DOT(r->pert,r->pert) > FTINY*FTINY)) { + if ( (hastexture = (DOT(r->pert,r->pert) > FTINY*FTINY)) ) { nd.pdot = raynormal(nd.pnorm, r); /* perturb normal */ } else { VCOPY(nd.pnorm, r->ron);