| 24 |
|
extern double specjitter; /* specular sampling jitter */ |
| 25 |
|
|
| 26 |
|
/* |
| 27 |
< |
* This routine uses portions of the reflection |
| 28 |
< |
* model described by Cook and Torrance. |
| 29 |
< |
* The computation of specular components has been simplified by |
| 30 |
< |
* numerous approximations and ommisions to improve speed. |
| 27 |
> |
* This routine implements the isotropic Gaussian |
| 28 |
> |
* model described by Ward in Siggraph `92 article. |
| 29 |
|
* We orient the surface towards the incoming ray, so a single |
| 30 |
|
* surface can be used to represent an infinitely thin object. |
| 31 |
|
* |
| 135 |
|
/* roughness + source */ |
| 136 |
|
dtmp = np->alpha2 + omega/PI; |
| 137 |
|
/* gaussian */ |
| 138 |
< |
dtmp = exp((2.*DOT(np->prdir,ldir)-2.)/dtmp)/(4.*PI*dtmp); |
| 138 |
> |
dtmp = exp((2.*DOT(np->prdir,ldir)-2.)/dtmp)/(PI*dtmp); |
| 139 |
|
/* worth using? */ |
| 140 |
|
if (dtmp > FTINY) { |
| 141 |
|
copycolor(ctmp, np->mcolor); |