Changeset 1677


Ignore:
Timestamp:
10/25/06 10:10:54 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
4 edited

Legend:

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

    r1676 r1677  
    444444                        if (hm->ConsiderMemory()) 
    445445                        { 
    446                                 const float rc = mRenderCostDecrease / hm->GetHierarchyStats().mTotalCost; 
     446                                //const float rc = mRenderCostDecrease / hm->GetHierarchyStats().mTotalCost; 
     447                                const float rc = mPriority / (hm->mInitialRenderCost - hm->GetHierarchyStats().mTotalCost + 1.0f); 
     448                                //cout << "\np: " << mPriority << " i: " << hm->mInitialRenderCost << " t: " << hm->GetHierarchyStats().mTotalCost << endl; 
    447449                                //const float mc = mMemoryIncr /  / hm->GetHierarchyStats().mMemory; 
    448450                                const float mc = (float)mPvsEntriesIncr / (float)hm->GetHierarchyStats().mPvsEntries;    
    449                                 //cout << "x"; 
    450                                 return hm->GetMemoryConst() * rc + (1.0f - hm->GetMemoryConst()) * mc; 
     451                                cout << "osp rc: " << rc << " mc: " << mc << endl; 
     452                                return hm->GetMemoryConst() * rc - (1.0f - hm->GetMemoryConst()) * mc; 
    451453                        } 
    452454                        else 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp

    r1676 r1677  
    361361 
    362362        // hack: assume that object space can be seen from view space 
    363         mHierarchyStats.mTotalCost = (float)objects.size(); 
     363        mHierarchyStats.mTotalCost = mInitialRenderCost = (float)objects.size(); 
    364364        // only one entry for start 
    365365        mHierarchyStats.mPvsEntries = 1; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h

    r1676 r1677  
    235235        inline float GetMemoryConst() const { return mMemoryConst; } 
    236236 
     237float mInitialRenderCost; 
    237238 
    238239protected: 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h

    r1676 r1677  
    489489                { 
    490490                        HierarchyManager *hm = sVspTree->mHierarchyManager; 
     491                         
    491492                        if (hm->ConsiderMemory()) 
    492493                        { 
    493                                 const float rc = mRenderCostDecrease / hm->GetHierarchyStats().mTotalCost; 
    494                                 const float mc = (float)mPvsEntriesIncr / (float)hm->GetHierarchyStats().mPvsEntries; 
    495                                 //cout << "y";                   
    496                                 return hm->GetMemoryConst() * rc + (1.0f - hm->GetMemoryConst()) * mc; 
     494                                //const float rc = mRenderCostDecrease / hm->GetHierarchyStats().mTotalCost; 
     495                                const float rc = mPriority / (hm->mInitialRenderCost - hm->GetHierarchyStats().mTotalCost + 1.0f); 
     496                                //const float mc = mMemoryIncr /  / hm->GetHierarchyStats().mMemory; 
     497                                const float mc = (float)mPvsEntriesIncr / (float)hm->GetHierarchyStats().mPvsEntries;    
     498                        cout << "vsp rc: " << rc << " mc: " << mc << endl; 
     499                                return hm->GetMemoryConst() * rc - (1.0f - hm->GetMemoryConst()) * mc; 
    497500                        } 
    498501                        else 
Note: See TracChangeset for help on using the changeset viewer.