Ignore:
Timestamp:
01/23/07 04:39:45 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
10 edited

Legend:

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

    r2021 r2023  
    1414#include "RayCaster.h" 
    1515 
    16 #include "PerfTimer.h" 
     16//#include "PerfTimer.h" 
    1717 
    1818 
    1919namespace GtpVisibilityPreprocessor { 
    2020 
    21   extern PerfTimer viewCellCastTimer; 
    22   extern PerfTimer pvsTimer; 
    23   extern PerfTimer objTimer; 
     21  //extern PerfTimer viewCellCastTimer; 
     22  //extern PerfTimer pvsTimer; 
     23  //extern PerfTimer objTimer; 
    2424 
    2525const bool pruneInvalidRays = true; 
     
    9494        mMixtureDistribution->ComputeContributions(vssRays); 
    9595 
    96         cout<<"view cell cast time:"<<viewCellCastTimer.TotalTime()<<" s"<<endl; 
    97         cout<<"pvs time:"<<pvsTimer.TotalTime()<<" s"<<endl; 
    98         cout<<"obj time:"<<objTimer.TotalTime()<<" s"<<endl; 
     96        //cout<<"view cell cast time:"<<viewCellCastTimer.TotalTime()<<" s"<<endl; 
     97        //cout<<"pvs time:"<<pvsTimer.TotalTime()<<" s"<<endl; 
     98        //cout<<"obj time:"<<objTimer.TotalTime()<<" s"<<endl; 
    9999 
    100100        if (mExportRays) { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r2017 r2023  
    349349{ 
    350350  Vector3 target = mViewPoint + mViewDirection; 
    351  
     351  //cout << "vp: " << mViewPoint << " dr: " << mViewDirection << endl; 
     352  //cout<<"box: " << mKdTree->GetBox()<<endl; 
    352353  Vector3 up(0,1,0); 
    353354   
     
    859860GlRendererBuffer::EvalPvsStat() 
    860861{ 
    861  
     862cout<<"here15"<<endl; 
    862863  MakeCurrent(); 
    863864 
     
    865866   
    866867  DoneCurrent(); 
    867    
     868  cout<<"here185"<<endl; 
    868869  //  mRenderingFinished.wakeAll(); 
    869870} 
     
    12891290} 
    12901291 
     1292bool GlRendererBuffer::ValidViewPoint() 
     1293{       cout << "here49" << endl; 
     1294        /*MakeCurrent(); 
     1295 
     1296        bool result = GlRenderer::ValidViewPoint(); 
     1297        DoneCurrent(); 
     1298*/bool result = true; 
     1299        return result; 
     1300} 
     1301 
    12911302 
    12921303void 
    12931304GlRenderer::EvalPvsStat() 
    12941305{ 
    1295  
     1306cout <<"here3399"<<endl; 
    12961307  mPvsStat.Reset(); 
    12971308  halton.Reset(); 
     
    13751386  glCullFace(GL_BACK); 
    13761387   
    1377   //  cout<<"VV1 "; 
     1388  //cout<<"VV1 "; 
    13781389  RenderScene(); 
    13791390   
     
    14051416   
    14061417  if (pixelCount > 0) 
     1418  {cout<<"count: " << pixelCount<<endl; 
    14071419        return false; // backfacing polygon found -> not a valid viewspace sample 
    1408  
     1420  } 
    14091421  return true; 
    14101422} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h

    r2017 r2023  
    145145  SetupProjection(const int w, const int h, const float angle = 70.0f); 
    146146 
    147   virtual bool 
    148   ValidViewPoint(); 
     147  virtual bool ValidViewPoint(); 
    149148   
    150149  virtual float 
     
    280279        virtual void DoneCurrent() = 0; 
    281280 
     281        virtual bool ValidViewPoint(); 
    282282 
    283283        virtual void SampleBeamContributions( 
  • GTP/trunk/Lib/Vis/Preprocessing/src/OcclusionQuery.cpp

    r2002 r2023  
    102102        if (sUseArbQueries) 
    103103        { 
    104 //              GLint sampleCount; 
    105104                glGetQueryObjectuivARB(mId, GL_QUERY_RESULT_ARB, &sampleCount); 
    106105                return sampleCount; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2021 r2023  
    11941194        } 
    11951195         
     1196        // reserve constant block of rays 
    11961197        mRayCaster->ReserveVssRayPool(2*mSamplesPerPass); 
    11971198         
     
    12121213#if 1 
    12131214  mRayCaster->SortRays(rays); 
    1214   cout<<"Rays sorted in "<<TimeDiff(t1, GetTime())<<" ms."<<endl; 
     1215  //cout<<"Rays sorted in "<<TimeDiff(t1, GetTime())<<" ms."<<endl; 
    12151216 
    12161217  if (0) { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj

    r2017 r2023  
    222222                                OptimizeForWindowsApplication="TRUE" 
    223223                                AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(CG_INC_PATH)&quot;" 
    224                                 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT" 
     224                                PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_CG" 
    225225                                ExceptionHandling="TRUE" 
    226226                                RuntimeLibrary="2" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r2019 r2023  
    77#include "RssTree.h" 
    88#include "Mutation.h" 
    9 #include "PerfTimer.h" 
     9//#include "PerfTimer.h" 
    1010 
    1111namespace GtpVisibilityPreprocessor { 
    1212 
    13 extern PerfTimer pvsTimer; 
     13//extern PerfTimer pvsTimer; 
    1414 
    1515//HaltonSequence SamplingStrategy::sHalton; 
     
    662662                                        if (strcmp(curr, "mutation")==0) { 
    663663                                          // temp matt: still no mutationstrategy! 
    664                                           mDistributions.push_back(new MutationBasedDistribution(mPreprocessor)); 
     664                                          //mDistributions.push_back(new MutationBasedDistribution(mPreprocessor)); 
    665665                                        } 
    666666         
  • GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj

    r2017 r2023  
    196196                                OptimizeForWindowsApplication="TRUE" 
    197197                                AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include&quot;;QtInterface" 
    198                                 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT" 
     198                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG" 
    199199                                RuntimeLibrary="2" 
    200200                                EnableEnhancedInstructionSet="2" 
     
    314314                                OptimizeForWindowsApplication="TRUE" 
    315315                                AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include&quot;;QtInterface" 
    316                                 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;USE_QT;TRY_GLOBAL_LINES" 
     316                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;USE_QT" 
    317317                                RuntimeLibrary="2" 
    318318                                RuntimeTypeInfo="TRUE" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r2021 r2023  
    2525#include "SceneGraph.h" 
    2626 
    27 #include "PerfTimer.h" 
     27//#include "PerfTimer.h" 
    2828 
    2929 
     
    3939 
    4040 
    41 PerfTimer viewCellCastTimer; 
    42 PerfTimer pvsTimer; 
    43 PerfTimer objTimer; 
     41//PerfTimer viewCellCastTimer; 
     42//PerfTimer pvsTimer; 
     43//PerfTimer objTimer; 
    4444 
    4545// HACK 
     
    510510                        mPreprocessor->GetRenderer()->mViewPoint = viewPoint; 
    511511                        mPreprocessor->GetRenderer()->mViewDirection = direction; 
    512  
    513                         if (mPreprocessor->GetRenderer()->ValidViewPoint()) 
     512                        //preprocessor->renderer->EvalPvsStat(); 
     513cout<<"*********hgere55"<<endl; 
     514                        if (preprocessor->renderer->ValidViewPoint()) 
    514515                        { 
    515516                                cout << "view point valid" << endl; 
    516517                                break; 
    517518                        } 
     519                        cout<<"here33"<<endl; 
    518520                } 
    519521 
     
    19992001        } 
    20002002 
    2001   cout<<"view cell cast time:"<<viewCellCastTimer.TotalTime()<<" s"<<endl; 
    2002   cout<<"pvs time:"<<pvsTimer.TotalTime()<<" s"<<endl; 
     2003  //cout<<"view cell cast time:"<<viewCellCastTimer.TotalTime()<<" s"<<endl; 
     2004 // cout<<"pvs time:"<<pvsTimer.TotalTime()<<" s"<<endl; 
    20032005   
    20042006  return sum; 
     
    26982700        ViewCell::NewMail(); 
    26992701         
    2700         viewCellCastTimer.Entry(); 
     2702        //viewCellCastTimer.Entry(); 
    27012703 
    27022704        static ViewCellContainer viewCells; 
     
    27122714        } 
    27132715         
    2714         viewCellCastTimer.Exit(); 
     2716        //viewCellCastTimer.Exit(); 
    27152717 
    27162718        mSamplesStat.mViewCells += (int)viewCells.size(); 
     
    27382740        //      objTimer.Exit(); 
    27392741         
    2740         pvsTimer.Entry(); 
     2742        //pvsTimer.Entry(); 
    27412743 
    27422744        ViewCellContainer::const_iterator it = viewCells.begin(); 
     
    27512753        } 
    27522754 
    2753         pvsTimer.Exit(); 
     2755        //pvsTimer.Exit(); 
    27542756 
    27552757        mSamplesStat.mPvsContributions += ray.mPvsContribution; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r2020 r2023  
    175175 
    176176        InitTiming(); 
     177        Debug.open("debug.log"); 
     178 
    177179#if 0 
    178         Debug.open("debug.log"); 
    179  
    180180        cout<<"Allocating 1.5GB..."<<endl; 
    181181 
     
    192192        } 
    193193#endif 
     194         
    194195        Environment::GetSingleton()->Parse(argc, argv, USE_EXE_PATH); 
    195196        MeshKdTree::ParseEnvironment(); 
     
    205206                exit(1); 
    206207        } 
     208 
    207209 
    208210        Environment::GetSingleton()->GetStringValue("Scene.filename", buff); 
     
    283285        } 
    284286 
    285         const string viewCellsFile = ReplaceSuffix(filename, ".obj", ".vc"); 
    286         const int numViewCells = 2; 
    287         const int numViewPoints = 2; 
     287        string viewCellsFile = ReplaceSuffix(filename, ".obj", ".vc"); 
     288        viewCellsFile = ReplaceSuffix(filename, ".dat", ".vc"); 
     289 
     290        const int numViewCells = 5; 
     291        const int numViewPoints = 20; 
    288292 
    289293        bool useHwGlobalLines; 
     
    361365                Environment::GetSingleton()->GetIntValue("Preprocessor.pvsRenderErrorSamples", frames); 
    362366                 
    363                 if (frames)  
     367                if (1)//frames)  
    364368                { 
    365369                        // NOTE: render texture should be power of 2 and square 
     
    373377                } 
    374378 
    375         /*      vector<ViewCellPoints *> myViewCells; 
     379                vector<ViewCellPoints *> myViewCells; 
    376380 
    377381                preprocessor->mViewCellsManager->GenerateRandomViewCells(myViewCells, numViewCells, numViewPoints); 
     
    381385                //preprocessor->mViewCellsManager->ImportRandomViewCells(viewCellsFile, myViewCells); 
    382386                CLEAR_CONTAINER(myViewCells); 
    383 */ 
     387 
     388                //preprocessor->renderer->EvalPvsStat(); 
     389 
    384390                qApp->exec(); 
    385391#endif 
Note: See TracChangeset for help on using the changeset viewer.