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