431 |
|
static int |
432 |
|
sample_sdcomp(BSDFDAT *ndp, SDComponent *dcp, int xmit) |
433 |
|
{ |
434 |
< |
int hasthru = (xmit && !(ndp->pr->crtype & (SPECULAR|AMBIENT)) |
435 |
< |
&& bright(ndp->cthru) > FTINY); |
436 |
< |
int nstarget = 1; |
437 |
< |
int nsent = 0; |
438 |
< |
int n; |
439 |
< |
SDError ec; |
440 |
< |
SDValue bsv; |
441 |
< |
double xrand; |
442 |
< |
FVECT vsmp, vinc; |
443 |
< |
RAY sr; |
434 |
> |
const int hasthru = (xmit && |
435 |
> |
!(ndp->pr->crtype & (SPECULAR|AMBIENT)) && |
436 |
> |
bright(ndp->cthru) > FTINY); |
437 |
> |
int nstarget = 1; |
438 |
> |
int nsent = 0; |
439 |
> |
int n; |
440 |
> |
SDError ec; |
441 |
> |
SDValue bsv; |
442 |
> |
double xrand; |
443 |
> |
FVECT vsmp, vinc; |
444 |
> |
RAY sr; |
445 |
|
/* multiple samples? */ |
446 |
|
if (specjitter > 1.5) { |
447 |
|
nstarget = specjitter*ndp->pr->rweight + .5; |
523 |
|
if (dfp == NULL) /* no specular component? */ |
524 |
|
return(0); |
525 |
|
|
525 |
– |
dimlist[ndims++] = (int)(size_t)ndp->mp; |
526 |
|
if (hasthru) { /* separate view sample? */ |
527 |
|
RAY tr; |
528 |
|
if (rayorigin(&tr, TRANS, ndp->pr, ndp->cthru) == 0) { |
535 |
|
} else |
536 |
|
hasthru = 0; |
537 |
|
} |
538 |
– |
ndims--; |
538 |
|
if (dfp->maxHemi - b <= FTINY) { /* how specular to sample? */ |
539 |
|
b = 0; |
540 |
|
} else { |
553 |
|
} |
554 |
|
return(ntotal); |
555 |
|
} |
556 |
< |
ndims += 2; /* else sample specular */ |
556 |
> |
dimlist[ndims] = (int)(size_t)ndp->mp; /* else sample specular */ |
557 |
> |
ndims += 2; |
558 |
|
for (n = dfp->ncomp; n--; ) { /* loop over components */ |
559 |
|
dimlist[ndims-1] = n + 9438; |
560 |
|
ntotal += sample_sdcomp(ndp, &dfp->comp[n], sflags==SDsampSpT); |