51 |
|
if (i) spinvector(tvec, tvec, outvec, phinc); |
52 |
|
if (tvec[2] > 0 ^ output_orient > 0) |
53 |
|
continue; |
54 |
< |
sum += eval_rbfrep(rbf, tvec) * output_orient*tvec[2]; |
54 |
> |
sum += eval_rbfrep(rbf, tvec) * COSF(tvec[2]); |
55 |
|
++n; |
56 |
|
} |
57 |
|
if (n < 2) /* should never happen! */ |
64 |
|
est_DSFrad(const RBFNODE *rbf, const FVECT outvec) |
65 |
|
{ |
66 |
|
const double rad_epsilon = 0.03; |
67 |
< |
const double DSFtarget = 0.60653066 * eval_rbfrep(rbf,outvec) |
68 |
< |
* output_orient*outvec[2]; |
67 |
> |
const double DSFtarget = 0.60653066 * eval_rbfrep(rbf,outvec) * |
68 |
> |
COSF(outvec[2]); |
69 |
|
double inside_rad = rad_epsilon; |
70 |
|
double outside_rad = 0.5; |
71 |
|
double DSFinside = eval_DSFsurround(rbf, outvec, inside_rad); |
99 |
|
static void |
100 |
|
comp_bsdf_spec(void) |
101 |
|
{ |
102 |
+ |
const double max_hemi = 0.9; |
103 |
|
double peak_sum = 0; |
104 |
|
double rad_sum = 0; |
105 |
|
int n = 0; |
121 |
|
} |
122 |
|
bsdf_spec_peak = peak_sum/(double)n; |
123 |
|
bsdf_spec_rad = rad_sum/(double)n; |
124 |
+ |
if ((2.*M_PI)*bsdf_spec_peak*bsdf_spec_rad*bsdf_spec_rad > max_hemi) |
125 |
+ |
bsdf_spec_peak = max_hemi/((2.*M_PI)*bsdf_spec_rad*bsdf_spec_rad); |
126 |
|
} |
127 |
|
|
128 |
|
/* Create a new migration holder (sharing memory for multiprocessing) */ |