Ignore:
Timestamp:
10/18/06 02:32:32 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp

    r1634 r1635  
    520520        // otherwise danger of being stuck in a local minimum!! 
    521521        const float factor = mRenderCostDecreaseWeight; 
    522         const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
     522        float priority; 
     523         
     524        if (mHierarchyManager->GetViewSpaceSubdivisionType() ==  
     525                HierarchyManager::NO_VIEWSPACE_SUBDIV) 
     526        { 
     527                //////////////// 
     528                //-- surface area heuristics 
     529 
     530        //      if (objects.empty()) 
     531        //              return 0.0f; 
     532 
     533                const AxisAlignedBox3 box = EvalBoundingBox(leaf->mObjects); 
     534                const float area = box.SurfaceArea(); 
     535                const float viewSpaceArea = mViewCellsManager->GetViewSpaceBox().SurfaceArea(); 
     536 
     537                priority = (float)leaf->mObjects.size() * area / viewSpaceArea; 
     538        } 
     539        else 
     540        { 
     541                priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
     542        } 
     543 
    523544#else 
    524545        const float priority = (float)-splitCandidate.mParentData.mDepth; 
     
    13601381float BvHierarchy::EvalRenderCost(const ObjectContainer &objects) const 
    13611382{        
    1362         if (mHierarchyManager->GetViewSpaceSubdivisionType() ==  
    1363                 HierarchyManager::NO_VIEWSPACE_SUBDIV) 
     1383        if (0 &&  
     1384                (mHierarchyManager->GetViewSpaceSubdivisionType() ==  
     1385                HierarchyManager::NO_VIEWSPACE_SUBDIV)) 
    13641386        { 
    13651387                //////////////// 
     
    14501472{ 
    14511473        // no view cells yet 
    1452         if (mHierarchyManager->GetViewSpaceSubdivisionType() ==  
     1474        if (0 && mHierarchyManager->GetViewSpaceSubdivisionType() ==  
    14531475                HierarchyManager::NO_VIEWSPACE_SUBDIV) 
    14541476                return; 
     
    15431565{ 
    15441566        // no view cells yet 
    1545         if (mHierarchyManager->GetViewSpaceSubdivisionType() ==  
     1567        if (0 && mHierarchyManager->GetViewSpaceSubdivisionType() ==  
    15461568                HierarchyManager::NO_VIEWSPACE_SUBDIV) 
    15471569                return 1; 
Note: See TracChangeset for help on using the changeset viewer.