23 |
|
extern double specthresh; /* specular sampling threshold */ |
24 |
|
extern double specjitter; /* specular sampling jitter */ |
25 |
|
|
26 |
+ |
extern int backvis; /* back faces visible? */ |
27 |
+ |
|
28 |
|
static gaussamp(); |
29 |
|
|
30 |
|
/* |
175 |
|
nd.alpha2 = m->oargs.farg[4]; |
176 |
|
if ((nd.alpha2 *= nd.alpha2) <= FTINY) |
177 |
|
nd.specfl |= SP_PURE; |
178 |
< |
/* reorient if necessary */ |
179 |
< |
if (r->rod < 0.0) |
180 |
< |
flipsurface(r); |
178 |
> |
/* check for back side */ |
179 |
> |
if (r->rod < 0.0) { |
180 |
> |
if (!backvis && m->otype != MAT_TRANS) { |
181 |
> |
raytrans(r); |
182 |
> |
return(1); |
183 |
> |
} |
184 |
> |
flipsurface(r); /* reorient if backvis */ |
185 |
> |
} |
186 |
|
/* get modifiers */ |
187 |
|
raytexture(r, m->omod); |
188 |
|
nd.pdot = raynormal(nd.pnorm, r); /* perturb normal */ |