195 |
|
} |
196 |
|
if (vypeak*tomsurr < peak_over*bright(vsurr)*ns) |
197 |
|
return; /* peak not peaky enough */ |
198 |
< |
if ((vypeak/ns - ndp->sd->tLamb.cieY*(1./PI))*tomsum <= .001) |
198 |
> |
if ((vypeak/ns - (ndp->vray[2] > 0 ? ndp->sd->tLambFront.cieY |
199 |
> |
: ndp->sd->tLambBack.cieY)*(1./PI))*tomsum <= .001) |
200 |
|
return; /* < 0.1% transmission */ |
201 |
|
copycolor(ndp->cthru, vpeak); /* already scaled by omega */ |
202 |
|
multcolor(ndp->cthru, ndp->pr->pcol); /* modify by pattern */ |
256 |
|
return(0); /* all diffuse */ |
257 |
|
sv = ndp->sd->rLambBack; |
258 |
|
break; |
259 |
< |
default: |
259 |
> |
case 1: |
260 |
|
if ((ndp->sd->tf == NULL) & (ndp->sd->tb == NULL)) |
261 |
|
return(0); /* all diffuse */ |
262 |
< |
sv = ndp->sd->tLamb; |
262 |
> |
sv = ndp->sd->tLambFront; |
263 |
|
break; |
264 |
+ |
case 2: |
265 |
+ |
if ((ndp->sd->tf == NULL) & (ndp->sd->tb == NULL)) |
266 |
+ |
return(0); /* all diffuse */ |
267 |
+ |
sv = ndp->sd->tLambBack; |
268 |
+ |
break; |
269 |
|
} |
270 |
|
if (sv.cieY > FTINY) { |
271 |
|
diffY = sv.cieY *= 1./PI; |
702 |
|
} |
703 |
|
} |
704 |
|
/* diffuse transmittance */ |
705 |
< |
cvt_sdcolor(nd.tdiff, &nd.sd->tLamb); |
705 |
> |
cvt_sdcolor(nd.tdiff, hitfront ? &nd.sd->tLambFront : &nd.sd->tLambBack); |
706 |
|
if (m->oargs.nfargs >= 9) { |
707 |
|
setcolor(ctmp, m->oargs.farg[6], |
708 |
|
m->oargs.farg[7], |