77 |
|
inpfile[i].isDSF = 1; |
78 |
|
continue; |
79 |
|
} |
80 |
< |
if (!strcasecmp(typ, "BSDF")) { |
80 |
> |
if (!strcasecmp(typ, "BSDF") || |
81 |
> |
!strcasecmp(typ, "BRDF") || |
82 |
> |
!strcasecmp(typ, "BTDF")) { |
83 |
|
inpfile[i].isDSF = 0; |
84 |
|
continue; |
85 |
|
} |
186 |
|
for (i = 0; i < ninpfiles; i++) |
187 |
|
if (!init_pabopto_inp(i, argv[i+1])) |
188 |
|
return(1); |
189 |
< |
qsort(inpfile, ninpfiles, sizeof(PGINPUT), &cmp_indir); |
189 |
> |
qsort(inpfile, ninpfiles, sizeof(PGINPUT), cmp_indir); |
190 |
|
/* compile measurements */ |
191 |
|
for (i = 0; i < ninpfiles; i++) |
192 |
|
if (!add_pabopto_inp(i)) |
238 |
|
if (dsf_grid[i][j].sum.n > 0) { |
239 |
|
ovec_from_pos(dir, i, j); |
240 |
|
bsdf = dsf_grid[i][j].sum.v / |
241 |
< |
(dsf_grid[i][j].sum.n*output_orient*dir[2]); |
241 |
> |
((double)dsf_grid[i][j].sum.n*output_orient*dir[2]); |
242 |
|
if (bsdf <= bsdf_min*.6) |
243 |
|
continue; |
244 |
|
bsdf = log(bsdf + 1e-5) - min_log; |
254 |
|
for (n = 0; n < dsf_list->nrbf; n++) { |
255 |
|
RBFVAL *rbf = &dsf_list->rbfa[n]; |
256 |
|
ovec_from_pos(dir, rbf->gx, rbf->gy); |
257 |
< |
bsdf = eval_rbfrep(dsf_list, dir) / (output_orient*dir[2]); |
257 |
> |
bsdf = eval_rbfrep(dsf_list, dir); |
258 |
|
bsdf = log(bsdf + 1e-5) - min_log; |
259 |
|
printf("red sphere p%04d\n0\n0\n", ++n); |
260 |
|
printf("4 %.6g %.6g %.6g %.6g\n\n", |
274 |
|
for (i = 0; i < GRIDRES; i++) |
275 |
|
for (j = 0; j < GRIDRES; j++) { |
276 |
|
ovec_from_pos(dir, i, j); |
277 |
< |
bsdf = eval_rbfrep(dsf_list, dir) / (output_orient*dir[2]); |
277 |
> |
bsdf = eval_rbfrep(dsf_list, dir); |
278 |
|
bsdf = log(bsdf + 1e-5) - min_log; |
279 |
|
fprintf(pfp, "%.8e %.8e %.8e\n", |
280 |
|
dir[0]*bsdf, dir[1]*bsdf, dir[2]*bsdf); |