24 |
|
|
25 |
|
COLOR *mypixel; /* pixels being rendered */ |
26 |
|
float *myweight; /* weights (used to compute final pixels) */ |
27 |
+ |
float *mydepth; /* depth values (visibility culling) */ |
28 |
|
int hres, vres; /* current horizontal and vertical res. */ |
29 |
|
|
30 |
|
extern int nowarn; /* turn warnings off? */ |
50 |
|
case 'p': /* pixel aspect/exposure */ |
51 |
|
if (badarg(argc-i-1,argv+i+1,"f")) |
52 |
|
goto userr; |
53 |
< |
if (argv[i][1] == 'a') |
53 |
> |
if (argv[i][2] == 'a') |
54 |
|
pixaspect = atof(argv[++i]); |
55 |
< |
else if (argv[i][1] == 'e') { |
55 |
> |
else if (argv[i][2] == 'e') { |
56 |
|
expval = atof(argv[++i]); |
57 |
|
if (argv[i][0] == '-' | argv[i][0] == '+') |
58 |
|
expval = pow(2., expval); |
98 |
|
} |
99 |
|
} |
100 |
|
/* open holodeck file */ |
101 |
< |
if (i >= argc) |
101 |
> |
if (i != argc-1) |
102 |
|
goto userr; |
103 |
< |
hdkfile = argv[i++]; |
103 |
> |
hdkfile = argv[i]; |
104 |
|
initialize(); |
105 |
|
/* render picture(s) */ |
106 |
|
if (seqstart <= 0) |
145 |
|
sprintf(errmsg, "error writing frame %d", fn); |
146 |
|
error(SYSTEM, errmsg); |
147 |
|
} |
148 |
+ |
#ifdef DEBUG |
149 |
|
if (blist.nb > 0 & rval > 0) { |
150 |
< |
sprintf(errmsg, "%.1f%% unrendered pixels in frame %d", |
151 |
< |
100.*rval/(hres*vres), fn); |
150 |
> |
sprintf(errmsg, "%d unrendered pixels in frame %d (%.1f%%)", |
151 |
> |
rval, fn, 100.*rval/(hres*vres)); |
152 |
|
error(WARNING, errmsg); |
153 |
|
} |
154 |
+ |
#endif |
155 |
|
} |
156 |
|
|
157 |
|
|
159 |
|
register PACKHEAD *bl; |
160 |
|
int nb; |
161 |
|
{ |
162 |
< |
extern int render_beam(); |
162 |
> |
extern int pixBeam(); |
163 |
|
register HDBEAMI *bil; |
164 |
|
register int i; |
165 |
|
|
170 |
|
bil[i].h = hdlist[bl[i].hd]; |
171 |
|
bil[i].b = bl[i].bi; |
172 |
|
} |
173 |
< |
hdloadbeams(bil, nb, render_beam); |
173 |
> |
hdloadbeams(bil, nb, pixBeam); |
174 |
> |
pixFlush(); |
175 |
|
free((char *)bil); |
176 |
|
} |
177 |
|
|
213 |
|
/* prepare image buffers */ |
214 |
|
bzero((char *)mypixel, hres*vres*sizeof(COLOR)); |
215 |
|
bzero((char *)myweight, hres*vres*sizeof(float)); |
216 |
+ |
bzero((char *)mydepth, hres*vres*sizeof(float)); |
217 |
|
} |
218 |
|
|
219 |
|
|
274 |
|
/* allocate picture buffer */ |
275 |
|
mypixel = (COLOR *)bmalloc(xres*yres*sizeof(COLOR)); |
276 |
|
myweight = (float *)bmalloc(xres*yres*sizeof(float)); |
277 |
< |
if (mypixel == NULL | myweight == NULL) |
277 |
> |
mydepth = (float *)bmalloc(xres*yres*sizeof(float)); |
278 |
> |
if (mypixel == NULL | myweight == NULL | mydepth == NULL) |
279 |
|
error(SYSTEM, "out of memory in initialize"); |
280 |
|
} |
281 |
|
|