14 |
|
#include "otypes.h" |
15 |
|
#include "rtotypes.h" |
16 |
|
#include "func.h" |
17 |
+ |
#include "pmapmat.h" |
18 |
|
|
19 |
|
/* |
20 |
|
* Arguments to this material include the color and specularity. |
128 |
|
scalecolor(ctmp, dtmp); |
129 |
|
addcolor(cval, ctmp); |
130 |
|
} |
131 |
< |
if (ldot > 0.0 ? np->rspec <= FTINY : np->tspec <= FTINY) |
131 |
> |
if ((ldot > 0.0 ? np->rspec <= FTINY : np->tspec <= FTINY) || |
132 |
> |
ambRayInPmap(np->pr)) |
133 |
|
return; /* diffuse only */ |
134 |
|
/* set up function */ |
135 |
|
setbrdfunc(np); |
142 |
|
lddx[3] = omega; |
143 |
|
/* compute BRTDF */ |
144 |
|
if (np->mp->otype == MAT_BRTDF) { |
145 |
< |
if (sa[6][0] == '0') /* special case */ |
145 |
> |
if (sa[6][0] == '0' && !sa[6][1]) /* special case */ |
146 |
|
colval(ctmp,RED) = 0.0; |
147 |
|
else |
148 |
|
colval(ctmp,RED) = funvalue(sa[6], 4, lddx); |
149 |
< |
if (sa[7][0] == '0') |
149 |
> |
if (sa[7][0] == '0' && !sa[7][1]) |
150 |
|
colval(ctmp,GRN) = 0.0; |
151 |
|
else if (!strcmp(sa[7],sa[6])) |
152 |
|
colval(ctmp,GRN) = colval(ctmp,RED); |
153 |
|
else |
154 |
|
colval(ctmp,GRN) = funvalue(sa[7], 4, lddx); |
155 |
< |
if (!strcmp(sa[8],sa[6])) |
155 |
> |
if (sa[8][0] == '0' && !sa[8][1]) |
156 |
> |
colval(ctmp,BLU) = 0.0; |
157 |
> |
else if (!strcmp(sa[8],sa[6])) |
158 |
|
colval(ctmp,BLU) = colval(ctmp,RED); |
159 |
|
else if (!strcmp(sa[8],sa[7])) |
160 |
|
colval(ctmp,BLU) = colval(ctmp,GRN); |
367 |
|
objerror(m, USER, "bad # arguments"); |
368 |
|
/* check for back side */ |
369 |
|
if (r->rod < 0.0) { |
370 |
< |
if (!backvis && m->otype != MAT_TFUNC |
367 |
< |
&& m->otype != MAT_TDATA) { |
370 |
> |
if (!backvis) { |
371 |
|
raytrans(r); |
372 |
|
return(1); |
373 |
|
} |