16 |
|
|
17 |
|
#include "func.h" |
18 |
|
|
19 |
+ |
extern int backvis; /* back faces visible? */ |
20 |
+ |
|
21 |
|
/* |
22 |
|
* Arguments to this material include the color and specularity. |
23 |
|
* String arguments include the reflection function and files. |
351 |
|
/* compute reflectance */ |
352 |
|
dtmp = 1.0 - nd.trans - nd.rspec; |
353 |
|
setcolor(nd.rdiff, dtmp, dtmp, dtmp); |
354 |
< |
/* fix orientation */ |
355 |
< |
if (r->rod < 0.0) |
356 |
< |
flipsurface(r); |
354 |
> |
/* check for back side */ |
355 |
> |
if (r->rod < 0.0) { |
356 |
> |
if (!backvis && m->otype != MAT_TFUNC |
357 |
> |
&& m->otype != MAT_TDATA) { |
358 |
> |
raytrans(r); |
359 |
> |
return(1); |
360 |
> |
} |
361 |
> |
flipsurface(r); /* reorient if backvis */ |
362 |
> |
} |
363 |
|
/* get modifiers */ |
364 |
|
raytexture(r, m->omod); |
365 |
|
nd.pdot = raynormal(nd.pnorm, r); /* perturb normal */ |