46 |
|
double dstrsrc = 0.0; /* square source distribution */ |
47 |
|
double shadthresh = .05; /* shadow threshold */ |
48 |
|
double shadcert = .5; /* shadow certainty */ |
49 |
< |
int directrelay = 0; /* number of source relays */ |
49 |
> |
int directrelay = 1; /* number of source relays */ |
50 |
|
int vspretest = 512; /* virtual source pretest density */ |
51 |
+ |
int directinvis = 0; /* sources invisible? */ |
52 |
+ |
double srcsizerat = .25; /* maximum ratio source size/dist. */ |
53 |
|
|
54 |
+ |
double specthresh = .15; /* specular sampling threshold */ |
55 |
+ |
double specjitter = 1.; /* specular sampling jitter */ |
56 |
+ |
|
57 |
|
int maxdepth = 6; /* maximum recursion depth */ |
58 |
|
double minweight = 4e-3; /* minimum ray weight */ |
59 |
|
|
239 |
|
int fmt; |
240 |
|
FILE *fp; |
241 |
|
{ |
242 |
+ |
extern char *fgetword(); |
243 |
|
static float vf[3]; |
244 |
+ |
char buf[32]; |
245 |
+ |
register int i; |
246 |
|
|
247 |
|
switch (fmt) { |
248 |
|
case 'a': /* ascii */ |
249 |
< |
if (fscanf(fp, "%lf %lf %lf", vec, vec+1, vec+2) != 3) |
250 |
< |
return(-1); |
249 |
> |
for (i = 0; i < 3; i++) { |
250 |
> |
if (fgetword(buf, sizeof(buf), fp) == NULL || |
251 |
> |
!isflt(buf)) |
252 |
> |
return(-1); |
253 |
> |
vec[i] = atof(buf); |
254 |
> |
} |
255 |
|
break; |
256 |
|
case 'f': /* binary float */ |
257 |
|
if (fread((char *)vf, sizeof(float), 3, fp) != 3) |