| 10 |
|
#include <string.h> |
| 11 |
|
#include <stdlib.h> |
| 12 |
|
#include <math.h> |
| 13 |
+ |
#include "rtprocess.h" |
| 14 |
|
#include "bsdfrep.h" |
| 15 |
|
|
| 16 |
|
const float colarr[6][3] = { |
| 91 |
|
#ifdef DEBUG |
| 92 |
|
fprintf(stderr, "Minimum BSDF set to %.4f\n", bsdf_min); |
| 93 |
|
#endif |
| 94 |
< |
min_log = log(bsdf_min*.5); |
| 94 |
> |
min_log = log(bsdf_min*.5 + 1e-5); |
| 95 |
|
/* output BSDF rep. */ |
| 96 |
|
for (n = 0; (n < 6) & (2*n+3 < argc); n++) { |
| 97 |
|
double theta = atof(argv[2*n+2]); |
| 131 |
|
for (i = 0; i < rbf->nrbf; i++) { |
| 132 |
|
ovec_from_pos(odir, rbf->rbfa[i].gx, rbf->rbfa[i].gy); |
| 133 |
|
bsdf = eval_rbfrep(rbf, odir) / (output_orient*odir[2]); |
| 134 |
< |
bsdf = log(bsdf) - min_log; |
| 134 |
> |
bsdf = log(bsdf + 1e-5) - min_log; |
| 135 |
|
printf("pmat sphere p%d\n0\n0\n4 %f %f %f %f\n", |
| 136 |
|
i+1, odir[0]*bsdf, odir[1]*bsdf, odir[2]*bsdf, |
| 137 |
|
.007*bsdf); |
| 156 |
|
} else |
| 157 |
|
bsdf = eval_rbfrep(rbf, odir) / |
| 158 |
|
(output_orient*odir[2]); |
| 159 |
< |
bsdf = log(bsdf) - min_log; |
| 159 |
> |
bsdf = log(bsdf + 1e-5) - min_log; |
| 160 |
|
fprintf(fp, "%.8e %.8e %.8e\n", |
| 161 |
|
odir[0]*bsdf, odir[1]*bsdf, odir[2]*bsdf); |
| 162 |
|
} |