| 28 |
|
register int i; |
| 29 |
|
/* set number of divisions */ |
| 30 |
|
if (ambacc <= FTINY && |
| 31 |
< |
wt > (d = 0.8*bright(ac)*r->rweight/(ambdiv*minweight))) |
| 31 |
> |
wt > (d = 0.8*intens(ac)*r->rweight/(ambdiv*minweight))) |
| 32 |
|
wt = d; /* avoid ray termination */ |
| 33 |
|
hp->nt = sqrt(ambdiv * wt / PI) + 0.5; |
| 34 |
|
i = ambacc > FTINY ? 3 : 1; /* minimum number of samples */ |
| 204 |
|
else |
| 205 |
|
addcolor(acol, dp->v); |
| 206 |
|
} |
| 207 |
< |
if (!divcnt) |
| 207 |
> |
if (!divcnt) { |
| 208 |
> |
if (div != NULL) |
| 209 |
> |
free((void *)div); |
| 210 |
|
return(0.0); /* no samples taken */ |
| 211 |
+ |
} |
| 212 |
|
if (divcnt < hemi.nt*hemi.np) { |
| 213 |
|
pg = dg = NULL; /* incomplete sampling */ |
| 214 |
|
hemi.ns = 0; |