238 |
|
{ |
239 |
|
int nsamp = 1; |
240 |
|
int scnt = 0; |
241 |
< |
FVECT vsrc, vjit; |
241 |
> |
FVECT vsrc; |
242 |
|
double tomega, tomega2; |
243 |
|
double tsr, sd[2]; |
244 |
|
SCOLOR csmp, cdiff; |
306 |
|
nsamp = 4.*specjitter*ndp->pr->rweight + .5; |
307 |
|
nsamp += !nsamp; |
308 |
|
} |
309 |
< |
/* jitter to fuzz BSDF cells */ |
310 |
< |
for (i = nsamp; i--; ) { |
309 |
> |
for (i = nsamp; i--; ) { /* jitter to fuzz BSDF cells */ |
310 |
> |
FVECT vjit; |
311 |
|
bsdf_jitter(vjit, ndp, tsr); |
312 |
|
/* compute BSDF */ |
313 |
|
ec = SDevalBSDF(&sv, vjit, vsrc, ndp->sd); |
314 |
|
if (ec) |
315 |
|
goto baderror; |
316 |
< |
if (sv.cieY - diffY <= FTINY) |
317 |
< |
continue; /* no specular part */ |
316 |
> |
if (sv.cieY - diffY <= FTINY) { |
317 |
> |
++scnt; /* still counts as 0 contribution */ |
318 |
> |
continue; |
319 |
> |
} |
320 |
|
/* check for variable resolution */ |
321 |
|
ec = SDsizeBSDF(&tomega2, vjit, vsrc, SDqueryMin, ndp->sd); |
322 |
|
if (ec) |