200 |
|
while (nsources--) |
201 |
|
freeobscache(&source[nsources]); |
202 |
|
#endif |
203 |
+ |
#ifdef SSKIPOPT |
204 |
+ |
sskip_rsi(NULL); |
205 |
+ |
#endif |
206 |
|
free(source); |
207 |
|
source = NULL; |
208 |
|
nsources = 0; |
451 |
|
cntord[sn].brt = sintens(scp->coef); |
452 |
|
if (cntord[sn].brt <= 0.0) |
453 |
|
continue; |
454 |
+ |
#ifdef SSKIPOPT |
455 |
+ |
if (ssf_select != NULL && sskip_chk(ssf_select, scp->sno)) |
456 |
+ |
scalescolor(scp->coef, r->scorr); |
457 |
+ |
#endif |
458 |
|
VCOPY(scp->dir, sr.rdir); |
459 |
|
copyscolor(sr.rcoef, scp->coef); |
460 |
|
/* compute potential */ |
501 |
|
break; |
502 |
|
scp = srccnt + cntord[sn].sndx; |
503 |
|
/* test for hit */ |
504 |
< |
rayorigin(&sr, SHADOW, r, NULL); |
504 |
> |
rayorigin(&sr, thrudir(r,scp->dir) ? TSHADOW : RSHADOW, r, NULL); |
505 |
|
copyscolor(sr.rcoef, scp->coef); |
506 |
|
VCOPY(sr.rdir, scp->dir); |
507 |
|
sr.rsrc = scp->sno; |
603 |
|
setcolor(cvext, re > 92. ? 0. : exp(-re), |
604 |
|
ge > 92. ? 0. : exp(-ge), |
605 |
|
be > 92. ? 0. : exp(-be)); |
606 |
< |
if (intens(cvext) <= FTINY) |
606 |
> |
if (intens(cvext) <= FTINY*FTINY) |
607 |
|
break; /* too far away */ |
608 |
|
sr.rorg[0] = r->rorg[0] + r->rdir[0]*t; |
609 |
|
sr.rorg[1] = r->rorg[1] + r->rdir[1]*t; |
610 |
|
sr.rorg[2] = r->rorg[2] + r->rdir[2]*t; |
611 |
|
|
612 |
|
if (!volumePhotonMapping) { |
613 |
+ |
if (srcskip(r->slights[i], r)) |
614 |
+ |
continue; |
615 |
|
initsrcindex(&si); /* sample ray to this source */ |
616 |
|
si.sn = r->slights[i]; |
617 |
|
nopart(&si, &sr); |
642 |
|
} |
643 |
|
/* other factors */ |
644 |
|
d *= si.dom * r->rot / (4.*PI*nsamps); |
645 |
+ |
#ifdef SSKIPOPT |
646 |
+ |
if (ssf_select != NULL && sskip_chk(ssf_select, sr.rsrc)) |
647 |
+ |
d *= r->scorr; |
648 |
+ |
#endif |
649 |
|
scalescolor(sr.rcol, d); |
650 |
|
} else { |
651 |
|
/* PMAP: Add ambient inscattering from |