Ignore:
Timestamp:
01/20/08 22:11:30 (17 years ago)
Author:
bittner
Message:

TEST PVS RENDERING ON

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
4 edited

Legend:

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

    r2616 r2619  
    2626 
    2727// if 1 = SAFE RENDERING OF PVS primitives without VBOs for Pvs error estimation 
    28 #define EVAL_ERROR 0 
     28#define EVAL_ERROR 1 
    2929 
    3030namespace GtpVisibilityPreprocessor { 
     
    8989        mSceneGraph->CollectObjects(mObjects); 
    9090 
    91 #if 1 
     91#if 0 
    9292        viewCellsManager->GetViewPoint(mViewPoint); 
    9393        mViewDirection = Vector3(0,0,1); 
    9494#else 
    95         mViewPoint = Vector3(1099.9,183.0,-387); 
    96         mViewDirection = Vector3(-0.6,0,-0.8); 
     95         
     96        mViewPoint = Vector3(1213.85, 176.988, -437.364); 
     97        mViewDirection = Vector3(0.433884, 0, -0.900969); 
     98         
     99        //mViewPoint = Vector3(1099.9,183.0,-387); 
     100        //mViewDirection = Vector3(-0.6,0,-0.8); 
    97101#endif 
    98102        mFrame = 0; 
     
    151155void GlRenderer::RenderIntersectable(Intersectable *object) 
    152156{ 
    153         if (!object || (object->mRenderedFrame == mCurrentFrame)) 
    154                 return; 
     157  if (!object || (object->mRenderedFrame == mCurrentFrame)) 
     158        return; 
    155159 
    156160        object->mRenderedFrame = mCurrentFrame; 
     
    448452GlRenderer::_RenderScene() 
    449453{ 
    450         ObjectContainer::const_iterator oi = mObjects.begin(); 
    451         for (; oi != mObjects.end(); oi++) 
    452                 RenderIntersectable(*oi); 
     454   
     455  ObjectContainer::const_iterator oi = mObjects.begin(); 
     456  for (; oi != mObjects.end(); oi++) 
     457        RenderIntersectable(*oi); 
    453458} 
    454459 
     
    531536GlRenderer::RenderScene() 
    532537{ 
    533         Intersectable::NewMail(); 
     538  mCurrentFrame++; 
     539   
     540  Intersectable::NewMail(); 
    534541#if DYNAMIC_OBJECTS_HACK 
    535542        Preprocessor *p = mViewCellsManager->GetPreprocessor(); 
     
    832839                RenderKdLeaf(static_cast<KdLeaf *>(node)); 
    833840#else 
    834                 KdLeaf *leaf = (KdLeaf *)node; 
     841                KdLeaf *leaf = static_cast<KdLeaf *>(node); 
    835842                for (int i=0; i < leaf->mObjects.size(); i++)  
    836                 { 
     843                  { 
    837844                        RenderIntersectable(leaf->mObjects[i]); 
    838                 } 
     845                  } 
    839846#endif 
    840847        }  
    841848        else  
    842849        { 
    843                 KdInterior *in = (KdInterior *)node; 
    844                 RenderKdNode(in->mBack); 
    845                 RenderKdNode(in->mFront); 
     850                KdInterior *inter = static_cast<KdInterior *>(node); 
     851                RenderKdNode(inter->mBack); 
     852                RenderKdNode(inter->mFront); 
    846853        } 
    847854} 
     
    14771484        // set frame id for saving the error buffer 
    14781485        mFrame = i; 
     1486 
    14791487        //      cerr<<"RV"<<endl; 
    14801488        RandomViewPoint(); 
     
    15161524          //      emit UpdatePvsErrorItem(i, 
    15171525          //                                                      mPvsErrorBuffer[i]); 
    1518           cout<<"("<<i<<","<<mPvsErrorBuffer[i].mError<<")"; 
     1526          cout<<"("<<i<<" ["<<mViewPoint<<"]["<<mViewDirection<<"] "<<mPvsErrorBuffer[i].mError<<")"; 
    15191527          //      swapBuffers(); 
    15201528        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2617 r2619  
    2121#define USE_CG 1 
    2222 
     23#define TEST_PVS_RENDERING 1 
    2324 
    2425#if USE_CG 
     
    132133        glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);  
    133134 
     135         
    134136        // Render PVS 
    135137        ObjectPvsIterator it = pvs.GetIterator(); 
     
    139141 
    140142        Intersectable::NewMail(); 
     143        mCurrentFrame++; 
    141144        while (it.HasMoreEntries())  
    142145          { 
     
    176179 
    177180 
    178         if (mSnapErrorFrames && (0 && pErrorPixels >= 0.01f)) { 
     181        if (mSnapErrorFrames && (pErrorPixels >= 0.01f)) { 
    179182          glReadBuffer(GL_BACK); 
    180183          //glReadBuffer(GL_FRONT); 
     
    211214          // Render PVS 
    212215          Intersectable::NewMail(); 
     216          mCurrentFrame++; 
    213217           
    214218           
     
    220224 
    221225          mUseForcedColors = false; 
    222            
    223226          im = toImage(); 
    224227          sprintf(filename, "error-frame-%04d-%0.5f-pvs.png", mFrame, pErrorPixels); 
     
    371374void QtGlRendererWidget::_RenderPvs() 
    372375{ 
    373         mUseFalseColors = false; 
     376 
     377#if TEST_PVS_RENDERING 
     378   
     379  ObjectPvsIterator it = mPvsCache.mPvs.GetIterator(); 
     380 
     381  int pvsSize = mPvsCache.mPvs.GetSize(); 
     382 
     383  Intersectable::NewMail(); 
     384  mCurrentFrame++; 
     385  while (it.HasMoreEntries())  
     386        { 
     387          RenderIntersectable(it.Next()); 
     388        } 
     389 
     390   
     391  return; 
     392#endif 
     393   
     394  mUseFalseColors = false; 
    374395 
    375396        int offset = (int)mObjects.size() * 3; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SG08/run_test_pixel

    r2613 r2619  
    44#COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 
    55#COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=500000 -samples_per_evaluation=10000000 -total_samples=500000000 -preprocessor_pvs_rendererror_samples=10000 -preprocessor_evaluatePixelError+" 
    6 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=1000000 -samples_per_evaluation=10000000 -total_samples=500000000 -preprocessor_pvs_rendererror_samples=10000 -preprocessor_evaluatePixelError+ -preprocessor_detect_empty_viewspace+ -kd_pvs_area=1e-4" 
     6COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_pass=500000 -samples_per_evaluation=100000 -total_samples=500000000 -preprocessor_pvs_rendererror_samples=100 -preprocessor_evaluatePixelError+ -preprocessor_detect_empty_viewspace+ -kd_pvs_area=1e-5 -view_cells_use_kd_pvs+ -af_use_kd_pvs+" 
    77 
    88#SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d" 
     
    3535#VIEWCELLS=../data/vienna/vienna-seq-viewcells-20000.xml.gz 
    3636 
    37 PREFIX=../work/plots/osp-vienna-SG08-PIXEL 
     37PREFIX=../work/plots/osp-vienna-SG08c-PIXEL 
    3838 
    3939#SCENE=../data/atlanta/atlanta2.x3d 
     
    4343$COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 
    4444-rss_distributions=mutation+object_direction+spatial -view_cells_filter_max_size=1 \ 
    45 -view_cells_use_kd_pvs+ -af_use_kd_pvs+ \ 
    4645-preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4l.xml \ 
    4746-preprocessor_stats=$PREFIX-i-mixed-b1-n4l.log \ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r2618 r2619  
    25912591 
    25922592        // check if last ray was not same ray with reverse direction 
    2593         //      if (1)  
     2593        if (1)  
    25942594                // tmp matt: don't use when origin objects are not accounted for, currently the second ray is lost!! 
    25952595          // $$JB: reenabled again - should use the same viewcells for the next ray ray if 
    25962596          // it goes in the oposite direction 
    2597         if (!lastVssRay || 
    2598                 !(ray.mOrigin == lastVssRay->mTermination) || 
    2599                 !(ray.mTermination == lastVssRay->mOrigin))  
     2597        //      if (!lastVssRay || 
     2598        //              !(ray.mOrigin == lastVssRay->mTermination) || 
     2599        //              !(ray.mTermination == lastVssRay->mOrigin))  
    26002600          { 
    26012601#ifdef USE_PERFTIMER   
Note: See TracChangeset for help on using the changeset viewer.