20 |
|
extern double specjitter; /* specular sampling jitter */ |
21 |
|
|
22 |
|
/* |
23 |
< |
* This anisotropic reflection model uses a variant on the |
24 |
< |
* exponential Gaussian used in normal.c. |
23 |
> |
* This routine implements the anisotropic Gaussian |
24 |
> |
* model described by Ward in Siggraph `92 article. |
25 |
|
* We orient the surface towards the incoming ray, so a single |
26 |
|
* surface can be used to represent an infinitely thin object. |
27 |
|
* |
117 |
|
dtmp2 *= dtmp2 / av2; |
118 |
|
/* gaussian */ |
119 |
|
dtmp = (dtmp1 + dtmp2) / (1.0 + DOT(np->pnorm, h)); |
120 |
< |
dtmp = exp(-2.0*dtmp) * 1.0/(4.0*PI) |
120 |
> |
dtmp = exp(-2.0*dtmp) * (1.0/4.0/PI) |
121 |
|
* sqrt(ldot/(np->pdot*au2*av2)); |
122 |
|
/* worth using? */ |
123 |
|
if (dtmp > FTINY) { |
163 |
|
} else |
164 |
|
dtmp = 0.0; |
165 |
|
/* gaussian */ |
166 |
< |
dtmp = exp(-dtmp) * 1.0/PI |
166 |
> |
dtmp = exp(-dtmp) * (1.0/PI) |
167 |
|
* sqrt(-ldot/(np->pdot*au2*av2)); |
168 |
|
/* worth using? */ |
169 |
|
if (dtmp > FTINY) { |