152 |
|
ambdone(); |
153 |
|
/* init ambient limits */ |
154 |
|
setambres(ambres); |
155 |
< |
setambacc(ambacc); |
155 |
> |
qambacc = sqrt(sqrt(ambacc *= (ambacc > FTINY))); |
156 |
|
if (ambfile == NULL || !ambfile[0]) |
157 |
|
return; |
158 |
|
if (ambacc <= FTINY) { |
398 |
|
delta_t2 = d*d; |
399 |
|
d = DOT(ck0, uvw[1]) / av->rad[1]; |
400 |
|
delta_t2 += d*d; |
401 |
< |
if (delta_t2 >= ambacc*ambacc) |
401 |
> |
if (delta_t2 >= qambacc*qambacc) |
402 |
|
continue; |
403 |
|
/* |
404 |
|
* Intersection behind test |
413 |
|
*/ |
414 |
|
extambient(ct, av, r->rop, rn, uvw); |
415 |
|
d = tfunc(maxangle, sqrt(delta_r2), 0.0) * |
416 |
< |
tfunc(ambacc, sqrt(delta_t2), 0.0); |
416 |
> |
tfunc(qambacc, sqrt(delta_t2), 0.0); |
417 |
|
scalecolor(ct, d); |
418 |
|
addcolor(acol, ct); |
419 |
|
wsum += d; |
461 |
|
/* compute ambient */ |
462 |
|
i = doambient(acol, r, amb.weight, uvw, amb.rad, amb.gpos, amb.gdir); |
463 |
|
scalecolor(acol, 1./AVGREFL); /* undo assumed reflectance */ |
464 |
< |
if (i <= 0) /* no Hessian => no storage */ |
464 |
> |
if (i <= 0 || amb.rad[0] <= FTINY) /* no Hessian or zero radius */ |
465 |
|
return(i); |
466 |
|
/* store value */ |
467 |
|
VCOPY(amb.pos, r->rop); |