| 25 |
|
#define MINADIV 7 /* minimum # divisions in each dimension */ |
| 26 |
|
#endif |
| 27 |
|
|
| 28 |
– |
extern void SDsquare2disk(double ds[2], double seedx, double seedy); |
| 29 |
– |
|
| 28 |
|
typedef struct { |
| 29 |
|
COLOR v; /* hemisphere sample value */ |
| 30 |
|
float d; /* reciprocal distance */ |
| 98 |
|
AMBSAMP *ap = &ambsam(hp,i,j); |
| 99 |
|
RAY ar; |
| 100 |
|
int hlist[3], ii; |
| 101 |
< |
double spt[2], zd; |
| 101 |
> |
RREAL spt[2]; |
| 102 |
> |
double zd; |
| 103 |
|
/* generate hemispherical sample */ |
| 104 |
|
/* ambient coefficient for weight */ |
| 105 |
|
if (ambacc > FTINY) |
| 117 |
|
hlist[2] = i; |
| 118 |
|
multisamp(spt, 2, urand(ilhash(hlist,3)+n)); |
| 119 |
|
resample: |
| 120 |
< |
SDsquare2disk(spt, (j+spt[1])/hp->ns, (i+spt[0])/hp->ns); |
| 120 |
> |
square2disk(spt, (j+spt[1])/hp->ns, (i+spt[0])/hp->ns); |
| 121 |
|
zd = sqrt(1. - spt[0]*spt[0] - spt[1]*spt[1]); |
| 122 |
|
for (ii = 3; ii--; ) |
| 123 |
|
ar.rdir[ii] = spt[0]*hp->ux[ii] + |