| 13 |
|
|
| 14 |
|
#include "ray.h" |
| 15 |
|
#include "rpaint.h" |
| 16 |
+ |
#include "otypes.h" |
| 17 |
+ |
#include "otspecial.h" |
| 18 |
|
#include "random.h" |
| 19 |
|
|
| 20 |
|
#ifndef WFLUSH |
| 116 |
|
} |
| 117 |
|
if (!direc || ourview.type == VT_PAR) { |
| 118 |
|
rayorigin(&thisray, PRIMARY, NULL, NULL); |
| 119 |
< |
if (!localhit(&thisray, &thescene)) { |
| 119 |
> |
while (localhit(&thisray, &thescene)) { |
| 120 |
> |
OBJREC *m = findmaterial(thisray.ro); |
| 121 |
> |
if (m != NULL && !istransp(m->otype) && |
| 122 |
> |
!isBSDFproxy(m) && |
| 123 |
> |
(thisray.clipset == NULL || |
| 124 |
> |
!inset(thisray.clipset, |
| 125 |
> |
thisray.ro->omod))) |
| 126 |
> |
break; /* found something */ |
| 127 |
> |
VCOPY(thisray.rorg, thisray.rop); |
| 128 |
> |
rayclear(&thisray); /* skip invisible */ |
| 129 |
> |
} |
| 130 |
> |
if ((thisray.ro == NULL) | (thisray.ro == &Aftplane)) { |
| 131 |
|
error(COMMAND, "not a local object"); |
| 132 |
|
return(-1); |
| 133 |
|
} |
| 237 |
|
} else if (ambounce == 0) |
| 238 |
|
flushintvl = ray_pnprocs*WFLUSH; |
| 239 |
|
else if (niflush < WFLUSH) |
| 240 |
< |
flushintvl = ray_pnprocs*niflush/(ambounce+1); |
| 240 |
> |
flushintvl = ray_pnprocs*niflush/(ambounce*(ambounce>0)+1); |
| 241 |
|
else |
| 242 |
< |
flushintvl = ray_pnprocs*WFLUSH/(ambounce+1); |
| 242 |
> |
flushintvl = ray_pnprocs*WFLUSH/(ambounce*(ambounce>0)+1); |
| 243 |
|
if (lastflush > counter) |
| 244 |
|
lastflush = 0; /* counter wrapped */ |
| 245 |
|
|