43 |
|
if (m->oargs.nfargs != 3 || m->oargs.nsargs > 1) |
44 |
|
objerror(m, USER, "bad number of arguments"); |
45 |
|
/* check for substitute material */ |
46 |
< |
if (m->oargs.nsargs > 0 && |
46 |
> |
/* but avoid double-counting */ |
47 |
> |
if (m->oargs.nsargs > 0 && !(r->crtype & (AMBIENT|SPECULAR)) && |
48 |
|
(r->rsrc < 0 || source[r->rsrc].so != r->ro)) { |
49 |
|
if (!strcmp(m->oargs.sarg[0], VOIDID)) { |
50 |
|
raytrans(r); |
56 |
|
if (r->rsrc >= 0 && source[r->rsrc].so != r->ro) |
57 |
|
return(1); |
58 |
|
|
59 |
< |
if (r->rod < 0.) /* back is black */ |
59 |
> |
if (r->rod < 0.) { /* back is black */ |
60 |
> |
if (!backvis) |
61 |
> |
raytrans(r); /* unless back visibility is off */ |
62 |
|
return(1); |
63 |
+ |
} |
64 |
|
/* get modifiers */ |
65 |
|
raytexture(r, m->omod); |
66 |
|
/* assign material color */ |
93 |
|
for (i = 0; i < 3; i++) |
94 |
|
nr.rdir[i] = r->rdir[i] + 2.*r->rod*r->ron[i]; |
95 |
|
} |
96 |
+ |
checknorm(nr.rdir); |
97 |
|
rayvalue(&nr); |
98 |
|
multcolor(nr.rcol, nr.rcoef); |
99 |
|
addcolor(r->rcol, nr.rcol); |