1 |
< |
/* Copyright (c) 1994 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
4 |
> |
static char SCCSid[] = "$SunId$ SGI"; |
5 |
|
#endif |
6 |
|
|
7 |
|
/* |
53 |
|
double dstrsrc = 0.0; /* square source distribution */ |
54 |
|
double shadthresh = .05; /* shadow threshold */ |
55 |
|
double shadcert = .5; /* shadow certainty */ |
56 |
< |
int directrelay = 1; /* number of source relays */ |
56 |
> |
int directrelay = 2; /* number of source relays */ |
57 |
|
int vspretest = 512; /* virtual source pretest density */ |
58 |
|
int directvis = 1; /* sources visible? */ |
59 |
< |
double srcsizerat = .25; /* maximum ratio source size/dist. */ |
59 |
> |
double srcsizerat = .2; /* maximum ratio source size/dist. */ |
60 |
|
|
61 |
+ |
COLOR cextinction = BLKCOLOR; /* global extinction coefficient */ |
62 |
+ |
COLOR salbedo = BLKCOLOR; /* global scattering albedo */ |
63 |
+ |
double seccg = 0.; /* global scattering eccentricity */ |
64 |
+ |
double ssampdist = 0.; /* scatter sampling distance */ |
65 |
+ |
|
66 |
|
double specthresh = .15; /* specular sampling threshold */ |
67 |
|
double specjitter = 1.; /* specular sampling jitter */ |
68 |
|
|
72 |
|
double minweight = 4e-3; /* minimum ray weight */ |
73 |
|
|
74 |
|
COLOR ambval = BLKCOLOR; /* ambient value */ |
75 |
+ |
int ambvwt = 0; /* initial weight for ambient value */ |
76 |
|
double ambacc = 0.2; /* ambient accuracy */ |
77 |
< |
int ambres = 32; /* ambient resolution */ |
78 |
< |
int ambdiv = 128; /* ambient divisions */ |
77 |
> |
int ambres = 128; /* ambient resolution */ |
78 |
> |
int ambdiv = 512; /* ambient divisions */ |
79 |
|
int ambssamp = 0; /* ambient super-samples */ |
80 |
|
int ambounce = 0; /* ambient bounces */ |
81 |
|
char *amblist[128]; /* ambient include/exclude list */ |
163 |
|
getvec(direc, inform, fp) == 0) { |
164 |
|
|
165 |
|
if (normalize(direc) == 0.0) { /* zero ==> flush */ |
166 |
< |
fflush(stdout); |
167 |
< |
continue; |
168 |
< |
} |
169 |
< |
samplendx++; |
166 |
> |
bogusray(); |
167 |
> |
if (--nextflush <= 0) { |
168 |
> |
fflush(stdout); |
169 |
> |
nextflush = hresolu; |
170 |
> |
} |
171 |
> |
} else { |
172 |
> |
samplendx++; |
173 |
|
/* compute and print */ |
174 |
< |
if (imm_irrad) |
175 |
< |
irrad(orig, direc); |
176 |
< |
else |
177 |
< |
rad(orig, direc); |
174 |
> |
if (imm_irrad) |
175 |
> |
irrad(orig, direc); |
176 |
> |
else |
177 |
> |
rad(orig, direc); |
178 |
|
/* flush if time */ |
179 |
< |
if (--nextflush == 0) { |
180 |
< |
fflush(stdout); |
181 |
< |
nextflush = hresolu; |
179 |
> |
if (--nextflush == 0) { |
180 |
> |
fflush(stdout); |
181 |
> |
nextflush = hresolu; |
182 |
> |
} |
183 |
|
} |
184 |
|
if (ferror(stdout)) |
185 |
|
error(SYSTEM, "write error"); |
250 |
|
} |
251 |
|
|
252 |
|
|
253 |
+ |
bogusray() /* print out empty record */ |
254 |
+ |
{ |
255 |
+ |
thisray.rorg[0] = thisray.rorg[1] = thisray.rorg[2] = |
256 |
+ |
thisray.rdir[0] = thisray.rdir[1] = thisray.rdir[2] = 0.0; |
257 |
+ |
rayorigin(&thisray, NULL, PRIMARY, 1.0); |
258 |
+ |
printvals(&thisray); |
259 |
+ |
} |
260 |
+ |
|
261 |
+ |
|
262 |
|
rad(org, dir) /* compute and print ray value(s) */ |
263 |
|
FVECT org, dir; |
264 |
|
{ |
531 |
|
register RAY *r; |
532 |
|
{ |
533 |
|
if (r->ro != NULL) |
534 |
< |
fputs(objptr(r->ro->omod)->oname, stdout); |
534 |
> |
if (r->ro->omod != OVOID) |
535 |
> |
fputs(objptr(r->ro->omod)->oname, stdout); |
536 |
> |
else |
537 |
> |
fputs(VOIDID, stdout); |
538 |
|
else |
539 |
|
putchar('*'); |
540 |
|
putchar('\t'); |