15 |
|
|
16 |
|
#include "ray.h" |
17 |
|
|
18 |
+ |
#include "ambient.h" |
19 |
+ |
|
20 |
|
#include "otypes.h" |
21 |
|
|
22 |
|
#include "random.h" |
89 |
|
|
90 |
|
/* Fresnel estimate */ |
91 |
|
ldiff = np->rdiff; |
92 |
< |
if (np->specfl & SP_PURE && (np->rspec > FTINY & ldiff > FTINY)) |
92 |
> |
if (np->specfl & SP_PURE && (np->rspec > FTINY) & (ldiff > FTINY)) |
93 |
|
ldiff *= 1. - FRESNE(fabs(ldot)); |
94 |
|
|
95 |
|
if (ldot > FTINY && ldiff > FTINY) { |
200 |
|
if ((nd.alpha2 *= nd.alpha2) <= FTINY) |
201 |
|
nd.specfl |= SP_PURE; |
202 |
|
|
203 |
< |
if (hastexture = (DOT(r->pert,r->pert) > FTINY*FTINY)) { |
203 |
> |
if ( (hastexture = (DOT(r->pert,r->pert) > FTINY*FTINY)) ) { |
204 |
|
nd.pdot = raynormal(nd.pnorm, r); /* perturb normal */ |
205 |
|
} else { |
206 |
|
VCOPY(nd.pnorm, r->ron); |