Ignore:
Timestamp:
10/22/06 17:35:23 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r1662 r1663  
    2828#define USE_VOLUMES_FOR_HEURISTICS 1 
    2929 
     30#define CONSIDER_MEMORY 1 
    3031 
    3132int BvhNode::sMailId = 10000; //2147483647; 
     
    502503        const bool maxCostRatioViolated = mTermMaxCostRatio < ratio; 
    503504 
     505        const int previousMisses = splitCandidate.mParentData.mMaxCostMisses; 
     506 
    504507        splitCandidate.SetMaxCostMisses(maxCostRatioViolated ?  
    505                 splitCandidate.mParentData.mMaxCostMisses + 1 : 
    506                 splitCandidate.mParentData.mMaxCostMisses); 
     508                previousMisses + 1 : previousMisses); 
    507509 
    508510        const float oldProp = EvalViewCellsVolume(leaf->mObjects); 
     
    516518        const float renderCostDecr = oldRenderCost - newRenderCost; 
    517519         
     520        splitCandidate.SetRenderCostDecrease(renderCostDecr); 
     521 
     522        // increase in pvs entries 
     523        const int pvsEntriesIncr = EvalPvsEntriesIncr(splitCandidate); 
     524        splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr); 
     525 
    518526#ifdef _DEBUG 
    519527        Debug << "old render cost: " << oldRenderCost << endl; 
     
    539547        else 
    540548        { 
     549                const float factor = mRenderCostDecreaseWeight; 
     550                 
    541551                // take render cost of node into account  
    542552                // otherwise danger of being stuck in a local minimum!! 
    543                 priority = mRenderCostDecreaseWeight * renderCostDecr +  
    544                                    (1.0f - mRenderCostDecreaseWeight) * oldRenderCost; 
     553                #if CONSIDER_MEMORY 
     554                        const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 
     555                #else 
     556                        const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
     557                #endif 
    545558        } 
    546559 
     
    548561        const float priority = (float)-splitCandidate.mParentData.mDepth; 
    549562#endif 
    550  
    551         splitCandidate.SetRenderCostDecrease(renderCostDecr); 
    552  
    553         // increase in pvs entries 
    554         const int pvsEntriesIncr = EvalPvsEntriesIncr(splitCandidate); 
    555         splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr); 
    556563 
    557564        // compute global decrease in render cost 
     
    583590        // otherwise danger of being stuck in a local minimum!! 
    584591        const float factor = mRenderCostDecreaseWeight; 
     592        // $$ matt temp 
     593#if CONSIDER_MEMORY 
     594        const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 
     595#else 
    585596        const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 
     597#endif 
    586598#else 
    587599        const float priority = (float)-splitCandidate.mParentData.mDepth; 
Note: See TracChangeset for help on using the changeset viewer.