Changeset 371 for trunk


Ignore:
Timestamp:
11/02/05 23:59:16 (19 years ago)
Author:
mattausch
Message:

added render heuristics evaluation

Location:
trunk/VUT
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibility/scripts/GtpVisibility.vcproj

    r370 r371  
    103103                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 
    104104                        <File 
    105                                 RelativePath="..\src\BatchedQueriesCullingManager.cpp"> 
    106                         </File> 
    107                         <File 
    108105                                RelativePath="..\src\CoherentHierarchicalCullingManager.cpp"> 
    109106                        </File> 
     
    140137                        Filter="h;hpp;hxx;hm;inl;inc;xsd" 
    141138                        UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 
    142                         <File 
    143                                 RelativePath="..\include\BatchedQueriesCullingManager.h"> 
    144                         </File> 
    145139                        <File 
    146140                                RelativePath="..\include\CoherentHierarchicalCullingManager.h"> 
  • trunk/VUT/GtpVisibility/src/VisibilityManager.cpp

    r370 r371  
    55#include "DummyPreprocessingManager.h" 
    66#include "DummyQueryManager.h" 
    7 #include "BatchedQueriesCullingManager.h" 
     7//#include "BatchedQueriesCullingManager.h" 
    88 
    99namespace GtpVisibility { 
  • trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env

    r370 r371  
    8282        #       input fromViewCells 
    8383        #       input fromSceneGeometry 
    84                 samples 200000 
     84                samples 100000 
    8585                sideTolerance 0.005 
    8686        } 
  • trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp

    r370 r371  
    531531                cout << "#totalPvsSize=" << mKdTree->CollectLeafPvs() << endl; 
    532532   
    533         // merge or subdivide view cells 
    534533        if (mBspTree) 
    535534        { 
     
    538537                Debug << "original pvs size: " << mBspTree->CountViewCellPvs() << endl; 
    539538 
     539                // merge or subdivide view cells 
    540540                long startTime = GetTime(); 
    541541                int merged = PostprocessViewCells(mSampleRays); 
     
    548548                Debug << "merged pvs size: " << mBspTree->CountViewCellPvs() << endl; 
    549549 
     550 
     551                cout << "evaluating render time heuristics ... "; 
     552                Real rt = EvaluateRenderHeuristics(); 
     553                cout << "finished" << endl; 
     554 
     555                Debug << "render time: " << rt * 1e-3 << endl; 
    550556        } 
    551557         
     
    881887        } 
    882888} 
     889 
     890Real SamplingPreprocessor::EvaluateRenderHeuristics() 
     891{ 
     892        Real renderTime = 0; 
     893 
     894        const float objRt = 1.0f; // render time for 1 object of PVS 
     895        const float vcOverhead = 1.0f; // const overhead for crossing a view cell border 
     896         
     897        float totalArea = 0; 
     898 
     899        ViewCellContainer viewCells; 
     900 
     901        mBspTree->CollectViewCells(viewCells); 
     902 
     903        ViewCellContainer::const_iterator it, it_end = viewCells.end(); 
     904        PolygonContainer::const_iterator pit; 
     905 
     906        for (it = viewCells.begin(); it != it_end; ++ it) 
     907        { 
     908                // surface area substitute for probability 
     909                PolygonContainer cell; 
     910                float area = 0; 
     911 
     912                mBspTree->ConstructGeometry(dynamic_cast<BspViewCell *>(*it), cell); 
     913 
     914                for (pit = cell.begin(); pit != cell.end(); ++ pit) 
     915                        area += (*pit)->GetArea(); 
     916                 
     917                renderTime += area * (*it)->GetPvs().GetSize() * objRt; 
     918                totalArea += area; 
     919        } 
     920 
     921        renderTime /= totalArea; 
     922 
     923        renderTime += (float)viewCells.size() * vcOverhead; 
     924         
     925        return renderTime; 
     926} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.h

    r369 r371  
    9797        int PostprocessViewCells(const RayContainer &rays); 
    9898 
     99        /** Simulated rendering using a simple render heuristics. Used to evaluate the  
     100                quality of the view cell partition. 
     101        */ 
     102        Real EvaluateRenderHeuristics(); 
    99103}; 
    100104 
Note: See TracChangeset for help on using the changeset viewer.