| 24 |
|
const double ssamp_thresh = 0.35; |
| 25 |
|
/* number of super-samples */ |
| 26 |
|
const int nssamp = 100; |
| 27 |
+ |
/* limit on number of RBF lobes */ |
| 28 |
+ |
static int lobe_lim = 15000; |
| 29 |
|
|
| 30 |
|
/* Output XML prologue to stdout */ |
| 31 |
|
static void |
| 122 |
|
|
| 123 |
|
data_prologue(); /* begin output */ |
| 124 |
|
if (pctcull >= 0) { |
| 125 |
< |
sprintf(cmd, "rttree_reduce -h -a -ff -r 3 -t %f -g %d", |
| 125 |
> |
sprintf(cmd, "rttree_reduce%s -h -ff -r 3 -t %f -g %d", |
| 126 |
> |
(input_orient>0 ^ output_orient>0) ? "" : " -a", |
| 127 |
|
pctcull, samp_order); |
| 128 |
|
fflush(stdout); |
| 129 |
|
ofp = popen(cmd, "w"); |
| 145 |
|
iovec[1] = .0; |
| 146 |
|
iovec[2] = input_orient * sqrt(1. - iovec[0]*iovec[0]); |
| 147 |
|
if (funame == NULL) |
| 148 |
< |
rbf = advect_rbf(iovec); |
| 148 |
> |
rbf = advect_rbf(iovec, lobe_lim); |
| 149 |
|
for (ox = 0; ox < sqres; ox++) { |
| 150 |
|
float last_bsdf = -1; |
| 151 |
|
for (oy = 0; oy < sqres; oy++) { |
| 227 |
|
|
| 228 |
|
data_prologue(); /* begin output */ |
| 229 |
|
if (pctcull >= 0) { |
| 230 |
< |
sprintf(cmd, "rttree_reduce -h -a -ff -r 4 -t %f -g %d", |
| 230 |
> |
sprintf(cmd, "rttree_reduce%s -h -ff -r 4 -t %f -g %d", |
| 231 |
> |
(input_orient>0 ^ output_orient>0) ? "" : " -a", |
| 232 |
|
pctcull, samp_order); |
| 233 |
|
fflush(stdout); |
| 234 |
|
ofp = popen(cmd, "w"); |
| 250 |
|
iovec[2] = input_orient * |
| 251 |
|
sqrt(1. - iovec[0]*iovec[0] - iovec[1]*iovec[1]); |
| 252 |
|
if (funame == NULL) |
| 253 |
< |
rbf = advect_rbf(iovec); |
| 253 |
> |
rbf = advect_rbf(iovec, lobe_lim); |
| 254 |
|
for (ox = 0; ox < sqres; ox++) { |
| 255 |
|
float last_bsdf = -1; |
| 256 |
|
for (oy = 0; oy < sqres; oy++) { |
| 360 |
|
case 'g': |
| 361 |
|
samp_order = atoi(argv[++i]); |
| 362 |
|
break; |
| 363 |
+ |
case 'l': |
| 364 |
+ |
lobe_lim = atoi(argv[++i]); |
| 365 |
+ |
break; |
| 366 |
|
default: |
| 367 |
|
goto userr; |
| 368 |
|
} |
| 430 |
|
return(0); |
| 431 |
|
userr: |
| 432 |
|
fprintf(stderr, |
| 433 |
< |
"Usage: %s [-g Nlog2][-t pctcull] [bsdf.sir ..] > bsdf.xml\n", |
| 433 |
> |
"Usage: %s [-g Nlog2][-t pctcull][-l maxlobes] [bsdf.sir ..] > bsdf.xml\n", |
| 434 |
|
progname); |
| 435 |
|
fprintf(stderr, |
| 436 |
|
" or: %s -t{3|4} [-g Nlog2][-t pctcull][{+|-}for[ward]][{+|-}b[ackward]][-e expr][-f file] bsdf_func > bsdf.xml\n", |