24 |
|
* surface can be used to represent an infinitely thin object. |
25 |
|
* |
26 |
|
* Arguments for MAT_PFUNC and MAT_MFUNC are: |
27 |
< |
* 2+ func funcfile transform .. |
27 |
> |
* 2+ func funcfile transform |
28 |
|
* 0 |
29 |
< |
* 4+ red grn blu specularity args .. |
29 |
> |
* 4+ red grn blu specularity A5 .. |
30 |
|
* |
31 |
|
* Arguments for MAT_PDATA and MAT_MDATA are: |
32 |
< |
* 4+ func datafile funcfile v0 .. transform .. |
32 |
> |
* 4+ func datafile funcfile v0 .. transform |
33 |
|
* 0 |
34 |
< |
* 4+ red grn blu specularity args .. |
34 |
> |
* 4+ red grn blu specularity A5 .. |
35 |
|
*/ |
36 |
|
|
37 |
|
extern double funvalue(), varvalue(); |
55 |
|
FVECT ldir; /* light source direction */ |
56 |
|
double omega; /* light source size */ |
57 |
|
{ |
58 |
+ |
extern XF funcxf; |
59 |
|
double ldot; |
60 |
|
double dtmp; |
61 |
|
COLOR ctmp; |
62 |
+ |
FVECT ldx; |
63 |
|
double pt[MAXDIM]; |
64 |
|
register int i; |
65 |
|
|
86 |
|
* Compute specular component. |
87 |
|
*/ |
88 |
|
setfunc(np->mp, np->pr); |
89 |
+ |
/* transform light vector */ |
90 |
+ |
multv3(ldx, ldir, funcxf.xfm); |
91 |
+ |
for (i = 0; i < 3; i++) |
92 |
+ |
ldx[i] /= funcxf.sca; |
93 |
+ |
/* evaluate BRDF */ |
94 |
|
errno = 0; |
95 |
|
if (np->dp == NULL) |
96 |
< |
dtmp = funvalue(np->mp->oargs.sarg[0], 3, ldir); |
96 |
> |
dtmp = funvalue(np->mp->oargs.sarg[0], 3, ldx); |
97 |
|
else { |
98 |
|
for (i = 0; i < np->dp->nd; i++) |
99 |
|
pt[i] = funvalue(np->mp->oargs.sarg[3+i], |
100 |
< |
3, ldir); |
100 |
> |
3, ldx); |
101 |
|
dtmp = datavalue(np->dp, pt); |
102 |
|
dtmp = funvalue(np->mp->oargs.sarg[0], 1, &dtmp); |
103 |
|
} |
122 |
|
register RAY *r; |
123 |
|
{ |
124 |
|
BRDFDAT nd; |
118 |
– |
double dtmp; |
125 |
|
COLOR ctmp; |
126 |
|
register int i; |
127 |
|
|