Ignore:
Timestamp:
10/24/06 17:42:03 (18 years ago)
Author:
mattausch
Message:

worked on pvs heuristics

File:
1 edited

Legend:

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

    r1673 r1676  
    256256         
    257257        // calculate cost in MB 
    258         const float memoryCost = mHierarchyStats.mMemory  / (1024.0f * 1024.0f) 
     258        const float memoryCost = mHierarchyStats.mMemory  / float(1024 * 1024) 
    259259                                                         + objectSpaceMem + viewSpaceMem; 
    260260 
     
    383383        // number of initial splits 
    384384        const int minSteps = mMinStepsOfSameType; 
     385        const int maxSteps = mMinStepsOfSameType + 500; 
    385386        float renderCostDecr = Limits::Infinity; 
    386387 
    387         SubdivisionCandidate *osc =  
    388                 PrepareObjectSpaceSubdivision(sampleRays, objects); 
     388        SubdivisionCandidate *osc = PrepareObjectSpaceSubdivision(sampleRays, objects); 
    389389         
    390390        objectSpaceQueue.Push(osc); 
     
    399399        // for first round, use sah splits. Once view space partition 
    400400        // has started, use render cost heuristics instead 
    401         const int ospSteps = RunConstruction(objectSpaceQueue, dirtyVspList, NULL, minSteps); 
     401        const int ospSteps =  
     402                RunConstruction(objectSpaceQueue, dirtyVspList, NULL, minSteps, maxSteps); 
    402403 
    403404        cout << "\n" << ospSteps << " object space partition steps taken" << endl; 
     
    440441                        // for first round, use sah splits. Once view space partition 
    441442                        // has started, use render cost heuristics instead 
    442                         const int ospSteps =  
    443                                 RunConstruction(objectSpaceQueue, dirtyVspList, viewSpaceQueue.Top(), minSteps); 
     443                        const int ospSteps = RunConstruction(objectSpaceQueue,  
     444                                                                                                 dirtyVspList,  
     445                                                                                                 viewSpaceQueue.Top(),  
     446                                                                                                 minSteps,  
     447                                                                                                 maxSteps); 
    444448 
    445449                        cout << "\n" << ospSteps << " object space partition steps taken" << endl; 
     
    461465                        // process view space candidates 
    462466                        const int vspSteps =  
    463                                 RunConstruction(viewSpaceQueue, dirtyOspList, objectSpaceQueue.Top(), minSteps); 
     467                                RunConstruction(viewSpaceQueue, dirtyOspList, objectSpaceQueue.Top(), minSteps, maxSteps); 
    464468 
    465469                        cout << "\n" << vspSteps << " view space partition steps taken" << endl; 
     
    700704 
    701705        // memory size in byte 
    702         mHierarchyStats.mMemory += (float)ObjectPvs::GetEntrySizeByte(); 
     706        mHierarchyStats.mMemory += (float)ObjectPvs::GetEntrySizeByte() * pvsEntriesIncr; 
    703707        mHierarchyStats.mRenderCostDecrease = sc->GetRenderCostDecrease(); 
    704708 
     
    841845 
    842846                        cout << "\nstarting object space subdivision after "  
    843                                  << mVspTree->mVspStats.nodes << " ("  
    844                                  << mMinStepsOfSameType << ") " << endl; 
     847                                 << mVspTree->mVspStats.nodes << " (" << mMinStepsOfSameType << ") " << endl; 
    845848 
    846849                        SubdivisionCandidate *ospSc = PrepareObjectSpaceSubdivision(sampleRays, objects); 
     
    895898                                                                          SubdivisionCandidateContainer &dirtyCandidates, 
    896899                                                                          SubdivisionCandidate *oldCandidate, 
    897                                                                           const int minSteps) 
    898 { 
     900                                                                          const int minSteps, 
     901                                                                          const int maxSteps) 
     902{ 
     903        if (minSteps >= maxSteps) 
     904                cout << "error!! " << minSteps << " equal or larger maxSteps" << endl; 
     905 
    899906        int steps = 0; 
    900907        SubdivisionCandidate::NewMail(); 
     
    908915 
    909916                // minimum slope reached 
    910                 if ((sc->GetPriority() < threshold) && !(steps < minSteps)) 
    911                 { 
    912                         cout << "**************** breaking on " << sc->GetPriority() << " smaller than " << threshold << endl; 
     917                if ((steps > maxSteps) ||  
     918                        ((sc->GetPriority() < threshold) && !(steps < minSteps))) 
     919                { 
     920                        cout << "\n**************** breaking on " << sc->GetPriority() << " smaller than " << threshold << endl; 
    913921                        break; 
    914922                } 
Note: See TracChangeset for help on using the changeset viewer.