i was looking over the ROAM article on gamasutra.com and grabbed the source code. i came across this:
// Compute variance on each of the base triangles…
m_CurrentVariance = m_VarianceLeft; RecursComputeVariance( 0, PATCH_SIZE, m_HeightMap[PATCH_SIZE * MAP_SIZE], PATCH_SIZE, 0, m_HeightMap[PATCH_SIZE], 0, 0, m_HeightMap, 1); m_CurrentVariance = m_VarianceRight; RecursComputeVariance( PATCH_SIZE, 0, m_HeightMap[ PATCH_SIZE], 0, PATCH_SIZE, m_HeightMap[ PATCH_SIZE * MAP_SIZE], PATCH_SIZE, PATCH_SIZE, m_HeightMap[(PATCH_SIZE * MAP_SIZE) + PATCH_SIZE], 1); // Clear the dirty flag for this patch m_VarianceDirty = 0;
the ROAM program creates a specified number of patches over the terrain, and the above function is called for each one…now…please correct me if i’m wrong, but wouldn’t the function do the same thing for every patch?! thanks in advance.