| 27 |
|
short nt, np; /* number of theta and phi directions */ |
| 28 |
|
} AMBHEMI; /* ambient sample hemisphere */ |
| 29 |
|
|
| 30 |
– |
extern double sin(), cos(), sqrt(); |
| 30 |
|
|
| 32 |
– |
|
| 31 |
|
static int |
| 32 |
|
ambcmp(d1, d2) /* decreasing order */ |
| 33 |
|
AMBSAMP *d1, *d2; |
| 146 |
|
arad += dp->r; |
| 147 |
|
} |
| 148 |
|
} |
| 149 |
< |
if (ns > 0) { /* perform super-sampling */ |
| 149 |
> |
if (ns > 0 && arad > FTINY && ndivs/arad < minarad) |
| 150 |
> |
ns = 0; /* close enough */ |
| 151 |
> |
else if (ns > 0) { /* else perform super-sampling */ |
| 152 |
|
comperrs(div, &hemi); /* compute errors */ |
| 153 |
|
qsort(div, ndivs, sizeof(AMBSAMP), ambcmp); /* sort divs */ |
| 154 |
|
/* super-sample */ |