438 |
|
} |
439 |
|
} |
440 |
|
} |
441 |
– |
|
442 |
– |
/* Compute minimum BSDF from histogram and clear it */ |
443 |
– |
static void |
444 |
– |
comp_bsdf_min() |
445 |
– |
{ |
446 |
– |
int cnt; |
447 |
– |
int i, target; |
448 |
– |
|
449 |
– |
cnt = 0; |
450 |
– |
for (i = HISTLEN; i--; ) |
451 |
– |
cnt += bsdf_hist[i]; |
452 |
– |
|
453 |
– |
target = cnt/100; /* ignore bottom 1% */ |
454 |
– |
cnt = 0; |
455 |
– |
for (i = 0; cnt <= target; i++) |
456 |
– |
cnt += bsdf_hist[i]; |
457 |
– |
bsdf_min = histval(i-1); |
458 |
– |
memset(bsdf_hist, 0, sizeof(bsdf_hist)); |
459 |
– |
} |
441 |
|
|
442 |
|
/* Build our triangle mesh from recorded RBFs */ |
443 |
|
void |
473 |
|
mesh_from_edge(create_migration(shrt_edj[0], shrt_edj[1])); |
474 |
|
else |
475 |
|
mesh_from_edge(create_migration(shrt_edj[1], shrt_edj[0])); |
495 |
– |
/* compute minimum BSDF */ |
496 |
– |
comp_bsdf_min(); |
476 |
|
/* complete migrations */ |
477 |
|
await_children(nchild); |
478 |
|
} |