395 |
|
copycolor(scol, np->scolor); |
396 |
|
ns2go = 1; |
397 |
|
if (specjitter > 1.5) { /* multiple samples? */ |
398 |
< |
ns2go = specjitter*r->rweight + .5; |
399 |
< |
if ((d = bright(scol)) <= minweight*ns2go) |
400 |
< |
ns2go = d/minweight; |
398 |
> |
ns2go = specjitter*sr.rweight + .5; |
399 |
> |
if (sr.rweight <= minweight*ns2go) |
400 |
> |
ns2go = sr.rweight/minweight; |
401 |
|
if (ns2go > 1) { |
402 |
|
d = 1./ns2go; |
403 |
|
scalecolor(scol, d); |
404 |
+ |
sr.rweight *= d; |
405 |
|
} else |
406 |
|
ns2go = 1; |
407 |
|
} |
431 |
|
continue; |
432 |
|
checknorm(sr.rdir); |
433 |
|
if (specjitter > 1.5) { /* adjusted W-G-M-D weight */ |
433 |
– |
copycolor(sr.rcoef, scol); |
434 |
|
d = 2.*(1. - np->pdot/d); |
435 |
+ |
copycolor(sr.rcoef, scol); |
436 |
|
scalecolor(sr.rcoef, d); |
437 |
|
rayclear(&sr); |
438 |
|
} |
448 |
|
scalecolor(sr.rcoef, np->tspec); |
449 |
|
if ((np->specfl & (SP_TRAN|SP_TBLT)) == SP_TRAN && |
450 |
|
rayorigin(&sr, SPECULAR, r, sr.rcoef) == 0) { |
450 |
– |
copycolor(scol, sr.rcoef); |
451 |
|
ns2go = 1; |
452 |
|
if (specjitter > 1.5) { /* multiple samples? */ |
453 |
< |
ns2go = specjitter*r->rweight + .5; |
454 |
< |
if ((d = bright(scol)) <= minweight*ns2go) |
455 |
< |
ns2go = d/minweight; |
453 |
> |
ns2go = specjitter*sr.rweight + .5; |
454 |
> |
if (sr.rweight <= minweight*ns2go) |
455 |
> |
ns2go = sr.rweight/minweight; |
456 |
|
if (ns2go > 1) { |
457 |
|
d = 1./ns2go; |
458 |
< |
scalecolor(scol, d); |
458 |
> |
scalecolor(sr.rcoef, d); |
459 |
> |
sr.rweight *= d; |
460 |
|
} else |
461 |
|
ns2go = 1; |
462 |
|
} |
481 |
|
if (DOT(sr.rdir, r->ron) >= -FTINY) |
482 |
|
continue; |
483 |
|
normalize(sr.rdir); /* OK, normalize */ |
484 |
< |
if (specjitter > 1.5) { /* multi-sampling */ |
484 |
< |
copycolor(sr.rcoef, scol); |
484 |
> |
if (specjitter > 1.5) /* multi-sampling */ |
485 |
|
rayclear(&sr); |
486 |
– |
} |
486 |
|
rayvalue(&sr); |
487 |
|
multcolor(sr.rcol, sr.rcoef); |
488 |
|
addcolor(r->rcol, sr.rcol); |