Game/src/main.cpp
// Compute the number of levels needed for a BVH that consists of a number of leaf nodes.

Compute the number of levels needed for a BVH that consists of a number of leaf nodes.
Compute the number of levels needed for a BVH that consists of a number of leaf nodes .
uint32_t GetNumLevels( uint32_t numLeaves )
{
    static const float log32f = glm::log( 32.0f );
    uint32_t numLevels = 0;
    if ( numLeaves > 0 )
    {
        numLevels = static_cast<uint32_t>( glm::ceil( glm::log( numLeaves ) / log32f ) );
    }
    return numLevels;
}
uint32_t GetNumLevels ( uint32_t numLeaves ) { static const float log32f = glm :: log ( 32.0f ) ; uint32_t numLevels = 0 ; if ( numLeaves > 0 ) { numLevels = static_cast < uint32_t > ( glm :: ceil ( glm :: log ( numLeaves ) / log32f ) ) ; } return numLevels ; }
Compute the number of levels needed for a BVH that consists of a number of leaf nodes.
Compute the number of levels needed for a BVH that consists of a number of leaf nodes .