| 689 |
|
addcolor(acol, ap->v); |
| 690 |
|
++cnt; |
| 691 |
|
} |
| 692 |
< |
if (!cnt) { |
| 693 |
< |
setcolor(rcol, 0.0, 0.0, 0.0); |
| 694 |
< |
free(hp); |
| 695 |
< |
return(0); /* no valid samples */ |
| 696 |
< |
} |
| 697 |
< |
if (cnt < hp->ns*hp->ns) { /* incomplete sampling? */ |
| 692 |
> |
if ((hp->ns < 4) | (cnt < hp->ns*hp->ns)) { |
| 693 |
> |
free(hp); /* inadequate sampling */ |
| 694 |
|
copycolor(rcol, acol); |
| 695 |
< |
free(hp); |
| 700 |
< |
return(-1); /* return value w/o Hessian */ |
| 695 |
> |
return(-cnt); /* value-only result */ |
| 696 |
|
} |
| 697 |
|
cnt = ambssamp*wt + 0.5; /* perform super-sampling? */ |
| 698 |
|
if (cnt > 8) |
| 700 |
|
copycolor(rcol, acol); /* final indirect irradiance/PI */ |
| 701 |
|
if ((ra == NULL) & (pg == NULL) & (dg == NULL)) { |
| 702 |
|
free(hp); |
| 703 |
< |
return(-1); /* no radius or gradient calc. */ |
| 703 |
> |
return(-1); /* no Hessian or gradients requested */ |
| 704 |
|
} |
| 705 |
|
if ((d = bright(acol)) > FTINY) { /* normalize Y values */ |
| 706 |
|
d = 0.99*(hp->ns*hp->ns)/d; |
| 737 |
|
if (ra[1] < minarad) |
| 738 |
|
ra[1] = minarad; |
| 739 |
|
} |
| 740 |
< |
ra[0] *= d = 1.0/sqrt(sqrt(wt)); |
| 740 |
> |
ra[0] *= d = 1.0/sqrt(wt); |
| 741 |
|
if ((ra[1] *= d) > 2.0*ra[0]) |
| 742 |
|
ra[1] = 2.0*ra[0]; |
| 743 |
|
if (ra[1] > maxarad) { |