--- ray/src/rt/normal.c 2003/03/12 04:59:05 2.41 +++ ray/src/rt/normal.c 2003/07/27 22:12:03 2.45 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: normal.c,v 2.41 2003/03/12 04:59:05 greg Exp $"; +static const char RCSid[] = "$Id: normal.c,v 2.45 2003/07/27 22:12:03 schorsch Exp $"; #endif /* * normal.c - shading function for normal materials. @@ -23,7 +23,7 @@ static const char RCSid[] = "$Id: normal.c,v 2.41 2003 #define MAXITER 10 /* maximum # specular ray attempts */ #endif /* estimate of Fresnel function */ -#define FRESNE(ci) (exp(-6.0*(ci)) - 0.00247875217) +#define FRESNE(ci) (exp(-5.85*(ci)) - 0.00287989916) static void gaussamp(); @@ -87,7 +87,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,14 +198,14 @@ 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); nd.pdot = r->rod; - if (r->ro != NULL && isflat(r->ro->otype)) - nd.specfl |= SP_FLAT; } + if (r->ro != NULL && isflat(r->ro->otype)) + nd.specfl |= SP_FLAT; if (nd.pdot < .001) nd.pdot = .001; /* non-zero for dirnorm() */ multcolor(nd.mcolor, r->pcol); /* modify material color */