Game/src/main.cpp
// Compute the number of (child) nodes needed to represent a BVH that consists of a number of leaf nodes.

Compute the number of (child) nodes needed to represent a BVH that consists of a number of leaf nodes.
Compute the number of ( child ) nodes needed to represent a BVH that consists of a number of leaf nodes .
uint32_t GetNumNodes( uint32_t numLeaves )
{
    uint32_t numLevels = GetNumLevels( numLeaves );
    uint32_t numNodes = 0;
    if ( numLevels > 0 && numLevels < _countof(gs_NumBVHNodes) )
    {
        numNodes = gs_NumBVHNodes[numLevels - 1];
    }
    return numNodes;
}
uint32_t GetNumNodes ( uint32_t numLeaves ) { uint32_t numLevels = GetNumLevels ( numLeaves ) ; uint32_t numNodes = 0 ; if ( numLevels > 0 && numLevels < _countof ( gs_NumBVHNodes ) ) { numNodes = gs_NumBVHNodes [ numLevels - 1 ] ; } return numNodes ; }
Compute the number of (child) nodes needed to represent a BVH that consists of a number of leaf nodes.
Compute the number of ( child ) nodes needed to represent a BVH that consists of a number of leaf nodes .