23 |
|
#define MAXITER 10 /* maximum # specular ray attempts */ |
24 |
|
#endif |
25 |
|
/* estimate of Fresnel function */ |
26 |
< |
#define FRESNE(ci) (exp(-6.0*(ci)) - 0.00247875217) |
26 |
> |
#define FRESNE(ci) (exp(-5.85*(ci)) - 0.00287989916) |
27 |
|
|
28 |
|
static void gaussamp(); |
29 |
|
|
87 |
|
|
88 |
|
/* Fresnel estimate */ |
89 |
|
ldiff = np->rdiff; |
90 |
< |
if (np->specfl & SP_PURE && (np->rspec > FTINY & ldiff > FTINY)) |
90 |
> |
if (np->specfl & SP_PURE && (np->rspec > FTINY) & (ldiff > FTINY)) |
91 |
|
ldiff *= 1. - FRESNE(fabs(ldot)); |
92 |
|
|
93 |
|
if (ldot > FTINY && ldiff > FTINY) { |
198 |
|
if ((nd.alpha2 *= nd.alpha2) <= FTINY) |
199 |
|
nd.specfl |= SP_PURE; |
200 |
|
|
201 |
< |
if (hastexture = (DOT(r->pert,r->pert) > FTINY*FTINY)) { |
201 |
> |
if ( (hastexture = (DOT(r->pert,r->pert) > FTINY*FTINY)) ) { |
202 |
|
nd.pdot = raynormal(nd.pnorm, r); /* perturb normal */ |
203 |
|
} else { |
204 |
|
VCOPY(nd.pnorm, r->ron); |
205 |
|
nd.pdot = r->rod; |
206 |
– |
if (r->ro != NULL && isflat(r->ro->otype)) |
207 |
– |
nd.specfl |= SP_FLAT; |
206 |
|
} |
207 |
+ |
if (r->ro != NULL && isflat(r->ro->otype)) |
208 |
+ |
nd.specfl |= SP_FLAT; |
209 |
|
if (nd.pdot < .001) |
210 |
|
nd.pdot = .001; /* non-zero for dirnorm() */ |
211 |
|
multcolor(nd.mcolor, r->pcol); /* modify material color */ |