6 |
|
*/ |
7 |
|
|
8 |
|
#include "copyright.h" |
9 |
+ |
|
10 |
|
#include "ray.h" |
11 |
|
#include "otypes.h" |
12 |
+ |
#include "rtotypes.h" |
13 |
|
#include "otspecial.h" |
14 |
|
|
15 |
|
/* |
24 |
|
*/ |
25 |
|
|
26 |
|
int |
27 |
< |
m_alias(m, r) /* transfer shading to alias target */ |
28 |
< |
OBJREC *m; |
29 |
< |
RAY *r; |
27 |
> |
m_alias( /* transfer shading to alias target */ |
28 |
> |
OBJREC *m, |
29 |
> |
RAY *r |
30 |
> |
) |
31 |
|
{ |
32 |
|
OBJECT aobj; |
33 |
|
OBJREC *aop; |
39 |
|
/* else replace alias */ |
40 |
|
if (m->oargs.nsargs != 1) |
41 |
|
objerror(m, INTERNAL, "bad # string arguments"); |
42 |
< |
aobj = lastmod(objndx(m), m->oargs.sarg[0]); |
43 |
< |
if (aobj < 0) |
44 |
< |
objerror(m, USER, "bad reference"); |
45 |
< |
aop = objptr(aobj); |
42 |
> |
aop = m; |
43 |
> |
aobj = objndx(aop); |
44 |
> |
do { /* follow alias trail */ |
45 |
> |
if (aop->oargs.nsargs == 1) |
46 |
> |
aobj = lastmod(aobj, aop->oargs.sarg[0]); |
47 |
> |
else |
48 |
> |
aobj = aop->omod; |
49 |
> |
if (aobj < 0) |
50 |
> |
objerror(aop, USER, "bad reference"); |
51 |
> |
aop = objptr(aobj); |
52 |
> |
} while (aop->otype == MOD_ALIAS); |
53 |
> |
/* copy struct */ |
54 |
|
arec = *aop; |
55 |
|
/* irradiance hack */ |
56 |
|
if (do_irrad && !(r->crtype & ~(PRIMARY|TRANS)) && |
57 |
< |
m->otype != MAT_CLIP && |
58 |
< |
(ofun[arec.otype].flags & (T_M|T_X))) { |
59 |
< |
if (irr_ignore(arec.otype)) { |
57 |
> |
(ofun[arec.otype].flags & (T_M|T_X)) && |
58 |
> |
arec.otype != MAT_CLIP) { |
59 |
> |
if (istransp(arec.otype) || isBSDFproxy(&arec)) { |
60 |
|
raytrans(r); |
61 |
|
return(1); |
62 |
|
} |