| 1 |
|
#ifndef lint |
| 2 |
< |
static const char RCSid[] = "$Id$"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 4 |
|
/* |
| 5 |
|
* normal.c - shading function for normal materials. |
| 182 |
|
raytrans(r); |
| 183 |
|
return(1); |
| 184 |
|
} |
| 185 |
+ |
raytexture(r, m->omod); |
| 186 |
|
flipsurface(r); /* reorient if backvis */ |
| 187 |
< |
} |
| 187 |
> |
} else |
| 188 |
> |
raytexture(r, m->omod); |
| 189 |
|
nd.mp = m; |
| 190 |
|
nd.rp = r; |
| 191 |
|
/* get material color */ |
| 197 |
|
nd.alpha2 = m->oargs.farg[4]; |
| 198 |
|
if ((nd.alpha2 *= nd.alpha2) <= FTINY) |
| 199 |
|
nd.specfl |= SP_PURE; |
| 200 |
< |
if (r->ro != NULL && isflat(r->ro->otype)) |
| 201 |
< |
nd.specfl |= SP_FLAT; |
| 200 |
< |
/* get modifiers */ |
| 201 |
< |
raytexture(r, m->omod); |
| 202 |
< |
if (hastexture = DOT(r->pert,r->pert) > FTINY*FTINY) |
| 200 |
> |
|
| 201 |
> |
if (hastexture = (DOT(r->pert,r->pert) > FTINY*FTINY)) { |
| 202 |
|
nd.pdot = raynormal(nd.pnorm, r); /* perturb normal */ |
| 203 |
< |
else { |
| 203 |
> |
} else { |
| 204 |
|
VCOPY(nd.pnorm, r->ron); |
| 205 |
|
nd.pdot = r->rod; |
| 206 |
+ |
if (r->ro != NULL && isflat(r->ro->otype)) |
| 207 |
+ |
nd.specfl |= SP_FLAT; |
| 208 |
|
} |
| 209 |
|
if (nd.pdot < .001) |
| 210 |
|
nd.pdot = .001; /* non-zero for dirnorm() */ |