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 |
|
/* |
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; |
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 |