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 -a -h -ff -r 3 -t %f -g %d", |
126 |
|
pctcull, samp_order); |
127 |
|
fflush(stdout); |
128 |
|
ofp = popen(cmd, "w"); |
144 |
|
iovec[1] = .0; |
145 |
|
iovec[2] = input_orient * sqrt(1. - iovec[0]*iovec[0]); |
146 |
|
if (funame == NULL) |
147 |
< |
rbf = advect_rbf(iovec); |
147 |
> |
rbf = advect_rbf(iovec, lobe_lim); |
148 |
|
for (ox = 0; ox < sqres; ox++) { |
149 |
|
float last_bsdf = -1; |
150 |
|
for (oy = 0; oy < sqres; oy++) { |
226 |
|
|
227 |
|
data_prologue(); /* begin output */ |
228 |
|
if (pctcull >= 0) { |
229 |
< |
sprintf(cmd, "rttree_reduce -h -a -ff -r 4 -t %f -g %d", |
229 |
> |
sprintf(cmd, "rttree_reduce%s -h -ff -r 4 -t %f -g %d", |
230 |
> |
(input_orient>0 ^ output_orient>0) ? "" : " -a", |
231 |
|
pctcull, samp_order); |
232 |
|
fflush(stdout); |
233 |
|
ofp = popen(cmd, "w"); |
249 |
|
iovec[2] = input_orient * |
250 |
|
sqrt(1. - iovec[0]*iovec[0] - iovec[1]*iovec[1]); |
251 |
|
if (funame == NULL) |
252 |
< |
rbf = advect_rbf(iovec); |
252 |
> |
rbf = advect_rbf(iovec, lobe_lim); |
253 |
|
for (ox = 0; ox < sqres; ox++) { |
254 |
|
float last_bsdf = -1; |
255 |
|
for (oy = 0; oy < sqres; oy++) { |
359 |
|
case 'g': |
360 |
|
samp_order = atoi(argv[++i]); |
361 |
|
break; |
362 |
+ |
case 'l': |
363 |
+ |
lobe_lim = atoi(argv[++i]); |
364 |
+ |
break; |
365 |
|
default: |
366 |
|
goto userr; |
367 |
|
} |
429 |
|
return(0); |
430 |
|
userr: |
431 |
|
fprintf(stderr, |
432 |
< |
"Usage: %s [-g Nlog2][-t pctcull] [bsdf.sir ..] > bsdf.xml\n", |
432 |
> |
"Usage: %s [-g Nlog2][-t pctcull][-l maxlobes] [bsdf.sir ..] > bsdf.xml\n", |
433 |
|
progname); |
434 |
|
fprintf(stderr, |
435 |
|
" or: %s -t{3|4} [-g Nlog2][-t pctcull][{+|-}for[ward]][{+|-}b[ackward]][-e expr][-f file] bsdf_func > bsdf.xml\n", |