| 299 |
|
register int i, j; |
| 300 |
|
|
| 301 |
|
if (s->sflags & (SDISTANT|SFLAT)) { |
| 302 |
< |
if (s->sflags & SDISTANT && ourview.type == VT_PAR) |
| 303 |
< |
return(0); /* all or nothing case */ |
| 302 |
> |
if (s->sflags & SDISTANT) { |
| 303 |
> |
if (ourview.type == VT_PAR) |
| 304 |
> |
return(0); /* all or nothing case */ |
| 305 |
> |
if (s->srad >= 0.05) |
| 306 |
> |
return(0); /* should never be a problem */ |
| 307 |
> |
} |
| 308 |
|
if (s->sflags & SFLAT) { |
| 309 |
|
for (i = 0; i < 3; i++) |
| 310 |
|
ap[i] = s->sloc[i] - ourview.vp[i]; |
| 444 |
|
if (source[sp->sn].sflags & SSPOT && |
| 445 |
|
spotout(&sr, source[sp->sn].sl.s)) |
| 446 |
|
continue; /* outside spot */ |
| 447 |
< |
w = poly_area(ppoly, npv) * hres * vres; |
| 444 |
< |
if (w < .95) { /* subpixel source */ |
| 445 |
< |
rayorigin(&sr, NULL, SHADOW, 1.0); |
| 446 |
< |
sr.rsrc = sp->sn; |
| 447 |
< |
} else |
| 448 |
< |
rayorigin(&sr, NULL, PRIMARY, 1.0); |
| 447 |
> |
rayorigin(&sr, NULL, PRIMARY, 1.0); |
| 448 |
|
rayvalue(&sr); /* compute value */ |
| 449 |
|
if (bright(sr.rcol) <= FTINY) |
| 450 |
|
continue; /* missed/blocked */ |
| 451 |
|
/* modify pixel */ |
| 452 |
+ |
w = poly_area(ppoly, npv) * hres * vres; |
| 453 |
|
if (zbf[y-y0] != NULL && |
| 454 |
< |
sr.rt < 0.99*zbf[y-y0][x-x0]) |
| 454 |
> |
sr.rt < 0.99*zbf[y-y0][x-x0]) { |
| 455 |
|
zbf[y-y0][x-x0] = sr.rt; |
| 456 |
< |
else if (!bigdiff(sr.rcol, pic[y-y0][x-x0], |
| 457 |
< |
0.01)) /* source sample */ |
| 458 |
< |
setcolor(pic[y-y0][x-x0], 0., 0., 0.); |
| 456 |
> |
} else if (!bigdiff(sr.rcol, pic[y-y0][x-x0], |
| 457 |
> |
0.01)) { /* source sample */ |
| 458 |
> |
scalecolor(pic[y-y0][x-x0], w); |
| 459 |
> |
continue; |
| 460 |
> |
} |
| 461 |
|
scalecolor(sr.rcol, w); |
| 462 |
|
scalecolor(pic[y-y0][x-x0], 1.-w); |
| 463 |
|
addcolor(pic[y-y0][x-x0], sr.rcol); |