Ignore:
Timestamp:
12/21/06 23:52:10 (18 years ago)
Author:
mattausch
Message:

added mechanism for histogram on certain MB in hierarchymanager
no more bug in undersampling estimation
added sampling strategy to spatial box based (also for eval)
added testing scripts

File:
1 edited

Legend:

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

    r1917 r1919  
    20582058                                                                                int &viewSpaceSplits, 
    20592059                                                                                int &objectSpaceSplits, 
    2060                                                                                 const bool useFilter) 
     2060                                                                                const bool useFilter, 
     2061                                                                                const bool useHisto, 
     2062                                                                                const int histoMem, 
     2063                                                                                const int pass, 
     2064                                                                                bool &histoUsed) 
    20612065{ 
    20622066        ViewCellContainer viewCells; 
     
    21212125                { 
    21222126                        ComputePvs(vc->GetPvs(), rc, pvsEntries); 
     2127                        vc->SetPvsCost(rc); 
    21232128                } 
    21242129 
     
    21322137        viewSpaceSplits = (int)viewCells.size(); 
    21332138        objectSpaceSplits = (int)bvhNodes.size(); 
     2139 
     2140        //////////////////////// 
     2141    //-- evaluate histogram for pvs size 
     2142 
     2143        if (useHisto && (memory <= (float)histoMem)) 
     2144        { 
     2145                char str[100]; 
     2146                char statsPrefix[100]; 
     2147                int histoStepSize; 
     2148 
     2149                Environment::GetSingleton()->GetStringValue("ViewCells.Evaluation.statsPrefix", statsPrefix); 
     2150         
     2151                cout << "computing pvs histogram for " << histoMem << " memory" << endl; 
     2152                Debug << "computing pvs histogram for " << histoMem << " memory" << endl; 
     2153                 
     2154                sprintf(str, "-%05d-%05d-histo-pvs.log", pass, histoMem); 
     2155                const string filename = string(statsPrefix) + string(str); 
     2156 
     2157                mVspTree->mViewCellsManager->EvalViewCellHistogramForPvsSize(filename, viewCells); 
     2158 
     2159                histoUsed = true; 
     2160        } 
     2161 
    21342162        //cout << "viewCells: " << (int)viewCells.size() << " nodes: " << (int)bvhNodes.size() << " rc: " << renderCost << " entries: " << pvsEntries << endl; 
    21352163 
     
    23252353void HierarchyManager::EvaluateSubdivision2(ofstream &splitsStats, 
    23262354                                                                                        const int splitsStepSize, 
    2327                                                                                         const bool useFilter) 
     2355                                                                                        const bool useFilter, 
     2356                                                                                        const bool useHisto, 
     2357                                                                                        const int histoMem, 
     2358                                                                                        const int pass) 
    23282359{ 
    23292360        vector<HierarchySubdivisionStats> subStatsContainer; 
     
    23312362        int splits = (1 + (mHierarchyStats.Leaves() - 1) / splitsStepSize) * splitsStepSize; 
    23322363        cout << "splits: " << splits << endl; 
     2364 
     2365        bool histoUsed = false; 
    23332366 
    23342367        while (1) 
     
    23422375                                                                                                subStats.mViewSpaceSplits, 
    23432376                                                                                                subStats.mObjectSpaceSplits, 
    2344                                                                                                 useFilter); 
     2377                                                                                                useFilter, 
     2378                                                                                                useHisto && !histoUsed, 
     2379                                                                                                histoMem, 
     2380                                                                                                pass, 
     2381                                                                                                histoUsed); 
    23452382 
    23462383                 
Note: See TracChangeset for help on using the changeset viewer.