93 |
|
normalize(vres); |
94 |
|
} |
95 |
|
|
96 |
< |
/* Evaluate BSDF for direct component, returning true if OK to proceed */ |
96 |
> |
/* Get BSDF specular for direct component, returning true if OK to proceed */ |
97 |
|
static int |
98 |
< |
direct_bsdf_OK(COLOR cval, FVECT ldir, double omega, BSDFDAT *ndp) |
98 |
> |
direct_specular_OK(COLOR cval, FVECT ldir, double omega, BSDFDAT *ndp) |
99 |
|
{ |
100 |
|
int nsamp, ok = 0; |
101 |
|
FVECT vsrc, vsmp, vjit; |
127 |
|
sv = ndp->sd->tLamb; |
128 |
|
break; |
129 |
|
} |
130 |
< |
if ((sv.cieY *= 1./PI) > FTINY) { |
131 |
< |
diffY = sv.cieY; |
130 |
> |
if (sv.cieY > FTINY) { |
131 |
> |
diffY = sv.cieY *= 1./PI; |
132 |
|
cvt_sdcolor(cdiff, &sv); |
133 |
|
} else { |
134 |
|
diffY = .0; |
238 |
|
if (ambRayInPmap(np->pr)) |
239 |
|
return; /* specular already in photon map */ |
240 |
|
/* |
241 |
< |
* Compute scattering coefficient using BSDF. |
241 |
> |
* Compute specular scattering coefficient using BSDF. |
242 |
|
*/ |
243 |
< |
if (!direct_bsdf_OK(ctmp, ldir, omega, np)) |
243 |
> |
if (!direct_specular_OK(ctmp, ldir, omega, np)) |
244 |
|
return; |
245 |
|
if (ldot < 0) { /* pattern for specular transmission */ |
246 |
|
multcolor(ctmp, np->pr->pcol); |
284 |
|
if (ambRayInPmap(np->pr)) |
285 |
|
return; /* specular already in photon map */ |
286 |
|
/* |
287 |
< |
* Compute reflection coefficient using BSDF. |
287 |
> |
* Compute specular reflection coefficient using BSDF. |
288 |
|
*/ |
289 |
< |
if (!direct_bsdf_OK(ctmp, ldir, omega, np)) |
289 |
> |
if (!direct_specular_OK(ctmp, ldir, omega, np)) |
290 |
|
return; |
291 |
|
dtmp = ldot * omega; |
292 |
|
scalecolor(ctmp, dtmp); |
326 |
|
if (ambRayInPmap(np->pr)) |
327 |
|
return; /* specular already in photon map */ |
328 |
|
/* |
329 |
< |
* Compute scattering coefficient using BSDF. |
329 |
> |
* Compute specular scattering coefficient using BSDF. |
330 |
|
*/ |
331 |
< |
if (!direct_bsdf_OK(ctmp, ldir, omega, np)) |
331 |
> |
if (!direct_specular_OK(ctmp, ldir, omega, np)) |
332 |
|
return; |
333 |
|
/* full pattern on transmission */ |
334 |
|
multcolor(ctmp, np->pr->pcol); |