Skip to main content

ebvh_build_hierarchy

ebvh_build_hierarchy(bvh, unprocessed_nodes, input_node_count, node_pool, node_pool_offset, [sah_optimization_level]) ⇒ number

Given a set of leaves, build intermediate node hierarchy on top, all the way up to the root Assumes nodes are spatially sorted NOTE: unprocessed_nodes will be modified during execution to save memory

Kind: global function
Returns: number - new root

ParamTypeDescription
bvhBVH
unprocessed_nodesArray.<number> | Uint32Arraycontains nodes that need to be built into a hierarchy, these must not be present in the BVH hierarchy
input_node_countnumber
node_poolArray.<number> | Uint32ArrayContains node indices that can be used to build ancestry hierarchy, need to be pre-allocated before calling this method
node_pool_offsetnumber
[sah_optimization_level]number