ebvh_build_hierarchy
ebvh_build_hierarchy(bvh, unprocessed_nodes, input_node_count, node_pool, node_pool_offset, [sah_optimization_level], [sah_optimization_bias]) ⇒ number
Given a set of leaves, build intermediate node hierarchy on top, all the way up to the root Assumes nodes are spatially sorted, if not - no guarantees can be made about quality NOTE: unprocessed_nodes will be modified during execution to save memory
Kind: global function
Returns: number - new root
| Param | Type | Description |
|---|---|---|
| bvh | BVH | |
| unprocessed_nodes | Array.<number> | Uint32Array | contains nodes that need to be built into a hierarchy, these must not be present in the BVH hierarchy |
| input_node_count | number | |
| node_pool | Array.<number> | Uint32Array | Contains node indices that can be used to build ancestry hierarchy, need to be pre-allocated before calling this method |
| node_pool_offset | number | |
| [sah_optimization_level] | number | |
| [sah_optimization_bias] | number | Adds an extra optimization run every X depth levels. Nodes closer to root are generally traversed more, so quality is significantly more important there. Plus, these levels have 1/2 of the nodes progressively, so it's much cheaper to optimize |