107 |
|
error(USER, errmsg); |
108 |
|
} |
109 |
|
if (cbuffer == NULL) { |
110 |
+ |
int n; |
111 |
|
/* compute resolution and allocate */ |
112 |
|
switch (sscanf(vval(RESOLUTION), "%d %d %lf", |
113 |
|
&hres, &vres, &pixaspect)) { |
143 |
|
(cprev==NULL) | (zprev == NULL) | |
144 |
|
(oprev==NULL) | (aprev==NULL)) |
145 |
|
error(SYSTEM, "out of memory in init_frame"); |
146 |
+ |
for (n = hres*vres; n--; ) { |
147 |
+ |
zprev[n] = -1.f; |
148 |
+ |
oprev[n] = OVOID; |
149 |
+ |
} |
150 |
|
frm_stop = getTime() + rtperfrm; |
151 |
|
} else { |
152 |
|
COLOR *cp; /* else just swap buffers */ |
376 |
|
if (!sample_here(x, y)) { /* just cast */ |
377 |
|
rayorigin(&ir, PRIMARY, NULL, NULL); |
378 |
|
if (!localhit(&ir, &thescene)) { |
379 |
< |
if (ir.ro != &Aftplane) |
380 |
< |
sourcehit(&ir); |
379 |
> |
if (ir.ro != &Aftplane && sourcehit(&ir)) { |
380 |
> |
rayshade(&ir, ir.ro->omod); |
381 |
> |
rayparticipate(&ir); |
382 |
> |
} |
383 |
|
copycolor(cbuffer[n], ir.rcol); |
384 |
|
zbuffer[n] = ir.rot; |
385 |
|
obuffer[n] = ir.robj; |
408 |
|
zbuffer[n] = ir.rot; |
409 |
|
obuffer[n] = ir.robj; |
410 |
|
sbuffer[n] = 1; |
411 |
< |
if (ir.rot >= FHUGE) |
411 |
> |
if (ir.rot >= 0.99*FHUGE) |
412 |
|
abuffer[n] = ADISTANT; |
413 |
|
else { |
414 |
|
abuffer[n] = ALOWQ; |
461 |
|
|
462 |
|
if (obj == OVOID) |
463 |
|
return(0); |
464 |
< |
op = objptr(obj); |
465 |
< |
if ((op->otype == OBJ_INSTANCE) & (op->omod == OVOID)) |
464 |
> |
op = objptr(obj); /* search for material */ |
465 |
> |
if (op->omod == OVOID) |
466 |
|
return(0); |
467 |
< |
/* search for material */ |
468 |
< |
do { |
469 |
< |
if (op->omod == OVOID || ofun[op->otype].flags & T_X) |
463 |
< |
return(0); |
464 |
< |
op = objptr(op->omod); |
465 |
< |
} while (!ismaterial(op->otype)); |
467 |
> |
op = findmaterial(objptr(op->omod)); |
468 |
> |
if (op == NULL) |
469 |
> |
return(0); |
470 |
|
/* |
471 |
|
* Since this routine is called to compute the difference |
472 |
|
* from rendering with and without interreflections, |
480 |
|
if (lv[0] == op->oname[0] && |
481 |
|
!strcmp(lv+1, op->oname+1)) |
482 |
|
break; |
483 |
< |
if ((lv != NULL) != hirendparams.ambincl) |
483 |
> |
if ((lv != NULL) ^ hirendparams.ambincl) |
484 |
|
return(0); |
485 |
|
} |
486 |
|
switch (op->otype) { |