64 |
|
int ii, jj; |
65 |
|
/* min. spacing = 1/4th division */ |
66 |
|
cos_thresh = (PI/4.)/(double)hp->ns; |
67 |
+ |
if (cos_thresh > 7.*PI/180.) /* 7 degrees is enough in any case */ |
68 |
+ |
cos_thresh = 7.*PI/180.; |
69 |
|
cos_thresh = 1. - .5*cos_thresh*cos_thresh; |
70 |
|
/* check existing neighbors */ |
71 |
|
for (ii = i-1; ii <= i+1; ii++) { |
114 |
|
if (rayorigin(&ar, hp->atyp, hp->rp, ar.rcoef) < 0) |
115 |
|
return(0); |
116 |
|
if (ambacc > FTINY) { |
115 |
– |
#ifdef SSKIPOPT |
116 |
– |
ar.rsrc = -1; /* protect cache from source opt. */ |
117 |
– |
ar.scorr = 1.f; |
118 |
– |
#endif |
117 |
|
smultscolor(ar.rcoef, hp->acoef); |
118 |
|
scalescolor(ar.rcoef, 1./AVGREFL); |
119 |
|
} |
129 |
|
spt[1]*hp->uy[ii] + |
130 |
|
zd*hp->onrm[ii]; |
131 |
|
checknorm(ar.rdir); |
132 |
< |
/* avoid coincident samples */ |
133 |
< |
if (!n && hp->ns >= 4 && ambcollision(hp, i, j, ar.rdir)) { |
132 |
> |
/* avoid coincident samples? */ |
133 |
> |
if (!n & (ambacc > FTINY) & (hp->ns >= 4) && |
134 |
> |
ambcollision(hp, i, j, ar.rdir)) { |
135 |
|
ss[0] = frandom(); ss[1] = frandom(); |
136 |
|
goto resample; /* reject this sample */ |
137 |
|
} |