358 |
|
ns2go = 1; |
359 |
|
if (specjitter > 1.5) { /* multiple samples? */ |
360 |
|
ns2go = specjitter*r->rweight + .5; |
361 |
< |
if ((d = bright(scol)) <= minweight*ns2go) |
362 |
< |
ns2go = d/minweight; |
361 |
> |
if (sr.rweight <= minweight*ns2go) |
362 |
> |
ns2go = sr.rweight/minweight; |
363 |
|
if (ns2go > 1) { |
364 |
|
d = 1./ns2go; |
365 |
|
scalecolor(scol, d); |
366 |
+ |
sr.rweight *= d; |
367 |
|
} else |
368 |
|
ns2go = 1; |
369 |
|
} |
399 |
|
continue; |
400 |
|
checknorm(sr.rdir); |
401 |
|
if (specjitter > 1.5) { /* adjusted W-G-M-D weight */ |
401 |
– |
copycolor(sr.rcoef, scol); |
402 |
|
d = 2.*(1. - np->pdot/d); |
403 |
+ |
copycolor(sr.rcoef, scol); |
404 |
|
scalecolor(sr.rcoef, d); |
405 |
|
rayclear(&sr); |
406 |
|
} |
416 |
|
scalecolor(sr.rcoef, np->tspec); |
417 |
|
if ((np->specfl & (SP_TRAN|SP_TBLT)) == SP_TRAN && |
418 |
|
rayorigin(&sr, SPECULAR, r, sr.rcoef) == 0) { |
418 |
– |
copycolor(scol, sr.rcoef); |
419 |
|
ns2go = 1; |
420 |
|
if (specjitter > 1.5) { /* multiple samples? */ |
421 |
|
ns2go = specjitter*r->rweight + .5; |
422 |
< |
if ((d = bright(scol)) <= minweight*ns2go) |
423 |
< |
ns2go = d/minweight; |
422 |
> |
if (sr.rweight <= minweight*ns2go) |
423 |
> |
ns2go = sr.rweight/minweight; |
424 |
|
if (ns2go > 1) { |
425 |
|
d = 1./ns2go; |
426 |
< |
scalecolor(scol, d); |
426 |
> |
scalecolor(sr.rcoef, d); |
427 |
> |
sr.rweight *= d; |
428 |
|
} else |
429 |
|
ns2go = 1; |
430 |
|
} |
455 |
|
if (DOT(sr.rdir, r->ron) >= -FTINY) |
456 |
|
continue; |
457 |
|
normalize(sr.rdir); /* OK, normalize */ |
458 |
< |
if (specjitter > 1.5) { /* multi-sampling */ |
458 |
< |
copycolor(sr.rcoef, scol); |
458 |
> |
if (specjitter > 1.5) /* multi-sampling */ |
459 |
|
rayclear(&sr); |
460 |
– |
} |
460 |
|
rayvalue(&sr); |
461 |
|
multcolor(sr.rcol, sr.rcoef); |
462 |
|
addcolor(r->rcol, sr.rcol); |