Ignore:
Timestamp:
01/24/08 11:41:38 (16 years ago)
Author:
bittner
Message:

siggraph submission

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

Legend:

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

    r2633 r2638  
    8989        mSceneGraph->CollectObjects(mObjects); 
    9090 
    91 #if 1 
     91#if 0 
    9292        viewCellsManager->GetViewPoint(mViewPoint); 
    9393        mViewDirection = Vector3(0,0,1); 
    9494#else 
    95          
    96         mViewPoint = Vector3(1213.85, 176.988, -437.364); 
    97         mViewDirection = Vector3(0.433884, 0, -0.900969); 
     95 
     96        // for sg snapshot 
     97        mViewPoint = Vector3(18.5133, 10.9818, -1032.24); 
     98        mViewDirection = Vector3(-0.5373, 0, 0.843391); 
     99           
     100          //    mViewPoint = Vector3(1213.85, 176.988, -437.364); 
     101          //    mViewDirection = Vector3(0.433884, 0, -0.900969); 
    98102         
    99103        //mViewPoint = Vector3(1099.9,183.0,-387); 
     
    505509 
    506510        glEnd(); 
    507  
     511         
    508512        glPopMatrix(); 
     513 
     514#if 1 
     515        // test the box of the object 
     516        AxisAlignedBox3 box = leaf->GetBox(); 
     517        RenderBox(box); 
     518#endif 
    509519} 
    510520 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HavranRayCaster.cpp

    r2635 r2638  
    433433               castDoubleRay, pruneInvalidRays); 
    434434 
     435        preprocessor->UpdateDynamicObjects(); 
    435436    if ((int)rays.size() > 100000 && i % (100000/16) == 0) 
    436437      cout<<"\r"<<offset<<"/"<<(int)rays.size()<<"\r"; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp

    r2636 r2638  
    99#include "ViewCell.h" 
    1010#include "IntersectableWrapper.h" 
     11 
    1112 
    1213 
     
    10651066    nodeStack.pop(); 
    10661067    if (node->IsLeaf() || node->mPvsTermination == 1)  { 
    1067       Intersectable *object = GetOrCreateKdIntersectable(node); 
    10681068      if (!node->Mailed()) { 
    1069         node->Mail(); 
    1070         objects.push_back(object); 
     1069                Intersectable *object = GetOrCreateKdIntersectable(node); 
     1070                node->Mail(); 
     1071                objects.push_back(object); 
    10711072      } 
    10721073    } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Makefile

    r2634 r2638  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (2.00a) (Qt 4.1.2) on: st 23. I 01:44:33 2008 
     3# Generated by qmake (2.00a) (Qt 4.1.2) on: st 23. I 19:46:53 2008 
    44# Project:  preprocessor.pro 
    55# Template: app 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2636 r2638  
    17311731 
    17321732        SceneGraphLeaf *leaf = new SceneGraphLeaf(dynamic); 
    1733  
    1734         if (LoadBinaryObj(filename, leaf, NULL, 100)) 
    1735         { 
     1733        bool parsed = false; 
     1734 
     1735        if (strstr(filename.c_str(), ".obj")) { 
     1736          cout<<"parsing obj file.."<<endl; 
     1737          ObjParser *p = new ObjParser; 
     1738          parsed = p->ParseFile(filename,  
     1739                                                        leaf, 
     1740                                                        false); 
     1741          leaf->UpdateBox(); 
     1742          cout<<leaf->GetBox(); 
     1743 
     1744          float s = 10.0f; 
     1745          leaf->ApplyTransform(ScaleMatrix(s, s, s)); 
     1746          leaf->ApplyTransform(TranslationMatrix(Vector3(0, 10, 0))); 
     1747 
     1748           
     1749        } else { 
     1750          cout<<"parsing binary obj file.."<<endl; 
     1751 
     1752          parsed = LoadBinaryObj(filename, leaf, NULL, 100); 
     1753        } 
     1754         
     1755        if (parsed) 
     1756          { 
     1757                cout<<"success."<<endl; 
     1758                leaf->UpdateBox(); 
     1759                cout<<leaf->GetBox(); 
    17361760                mDynamicObjects.push_back(leaf); 
    1737                 leaf->RebuildKtbTree(); 
     1761                //        leaf->RebuildKtbTree(); 
    17381762                mSceneGraph->GetRoot()->mChildren.push_back(leaf); 
    1739  
     1763                 
    17401764                if (mRayCaster) 
    17411765                  mRayCaster->AddDynamicObjecs(leaf->mGeometry, leaf->GetTransformation()); 
    1742  
    1743  
     1766                 
     1767           
    17441768                return true; 
    1745         } 
     1769          } else 
     1770                { 
     1771                  cout<<"failed."<<endl; 
     1772 
     1773                } 
    17461774 
    17471775#endif 
     
    17591787  AxisAlignedBox3 box = object->GetBox(); 
    17601788 
    1761   KdNode::NewMail(); 
    1762  
    17631789  ObjectContainer objects; 
    1764   // first mail all kDObjects which are intersected by the object 
    1765   preprocessor->mKdTree->CollectKdObjects(box, 
    1766                                                                                   objects); 
    1767    
     1790 
     1791  if (0) { 
     1792        // simplified computation taking only the objects intersecting the box 
     1793        KdNode::NewMail(); 
     1794         
     1795        // first mail all kDObjects which are intersected by the object 
     1796        preprocessor->mKdTree->CollectKdObjects(box, 
     1797                                                                                        objects); 
     1798         
     1799  } else { 
     1800        ViewCellContainer viewCells; 
     1801        mViewCellsManager->ComputeBoxIntersections(box, viewCells); 
     1802         
     1803        ViewCellContainer::const_iterator it = viewCells.begin(), it_end = viewCells.end(); 
     1804         
     1805        ObjectPvs pvs; 
     1806         
     1807        for (int i=0; it != it_end; ++ it, ++ i) { 
     1808          //cout<<"v"<<i<<" pvs="<<(*it)->GetPvs().mEntries.size()<<endl; 
     1809          pvs.MergeInPlace((*it)->GetPvs()); 
     1810        } 
     1811 
     1812        ObjectPvsIterator pit = pvs.GetIterator(); 
     1813        while (pit.HasMoreEntries())  {          
     1814          PvsData pvsData; 
     1815          Intersectable *object = pit.Next(pvsData); 
     1816          objects.push_back(object); 
     1817        } 
     1818  } 
     1819   
     1820  int pvsCounter = 0; 
    17681821  // now search for pvss which contained any mailed node 
    17691822  for (vit = mViewCellsManager->GetViewCells().begin(); vit != vit_end; ++ vit) { 
     
    17751828                // clear the pvs 
    17761829                pvs.Clear(); 
     1830                pvsCounter++; 
    17771831                break; 
    17781832          } 
    17791833        } 
    17801834  } 
     1835 
     1836  cout<<"Number of affected objects "<<objects.size()<<endl; 
     1837  cout<<"Cleared "<<pvsCounter<<" PVSs ("<<mViewCellsManager->GetViewCells().size()/ 
     1838        (float)pvsCounter*100.0f<<"%) "<<endl; 
    17811839   
    17821840} 
     
    17861844{ 
    17871845  if (mUpdateDynamicObjects) { 
     1846 
    17881847        preprocessor->mRayCaster->DeleteDynamicObjects(); 
    17891848         
    17901849        for (int i=0; i < mDynamicObjects.size(); i++) { 
    17911850          SceneGraphLeaf *l = mDynamicObjects[i]; 
     1851          cout<<"Updating dynamic objects in ray caster..."<<endl; 
    17921852          mRayCaster->AddDynamicObjecs(l->mGeometry, l->GetTransformation()); 
     1853          cout<<"done."<<endl; 
     1854          cout<<"Updating affected PVSs..."<<endl; 
    17931855          preprocessor->ObjectMoved(l); 
     1856          cout<<"done."<<endl; 
     1857           
    17941858        } 
    17951859        mUpdateDynamicObjects = false; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2636 r2638  
    600600        glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);  
    601601 
    602         mUseForcedColors = true; 
    603  
    604         glColor3f(0.0f, 0.8f, 0.2f); 
     602        //mUseForcedColors = true; 
     603 
     604        //      glColor3f(0.0f, 0.8f, 0.2f); 
     605        //      glColor3f(0.5f, 0.5f, 0.5f); 
     606 
     607        glColor3f(0.6f, 0.6f, 0.6f); 
    605608 
    606609        // Render PVS 
     
    617620 
    618621        SetupCamera(); 
     622 
     623        mUseForcedColors = true; 
    619624 
    620625        glColor3f(1.0f, 0.0f, 0.0f); 
     
    705710                        case 0: 
    706711                                { 
     712                                  if (e->modifiers() & Qt::ShiftModifier) { 
     713                                        const Vector3 transl(0, diffy, 0); 
     714                                        tm = TranslationMatrix(transl); 
     715                                   
     716                                  } else { 
    707717                                        const Vector3 transl(diffx, 0, diffy); 
    708                                          
    709718                                        tm = TranslationMatrix(transl); 
     719                                  } 
    710720                                } 
    711721                                break; 
     
    720730                        case 2: 
    721731                                { 
    722                                         tm = RotationXMatrix(diffx) * RotationYMatrix(diffy); 
     732                                  //                                    tm = RotationXMatrix(diffx) * RotationYMatrix(diffy); 
     733                                  tm = RotationYMatrix(diffx); 
    723734                                } 
    724735                                break; 
     
    791802        RenderInfo(); 
    792803        mFrame ++; 
     804        //      cout<<"vp="<<mViewPoint<<" vd="<<mViewDirection<<endl; 
    793805} 
    794806 
     
    10941106void QtGlRendererWidget::LoadObject() 
    10951107{ 
    1096         string filename("../data/teapot.bn"); 
     1108  //    string filename("../data/teapot.bn"); 
     1109  // string filename("../data/teapot.bn"); 
     1110  string filename("../data/cube.obj"); 
    10971111         
    10981112        cout << "Loading model << " << filename << endl; 
     
    12541268        renderText(20, 40, s); 
    12551269#endif 
    1256          
     1270#if 0 
    12571271        QFont font40; font40.setPointSize(30); 
    12581272        s.sprintf("PVS: %04d", mPvsSize); 
    12591273        renderText(20, 40, s, font40); 
    1260  
     1274#endif 
     1275         
    12611276/*      QFont font40; font40.setPointSize(30); 
    12621277        s.sprintf("New triangles: %04d", 100); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RenderSampler.cpp

    r1004 r2638  
    2727        Environment::GetSingleton()->GetBoolValue("RenderSampler.useOcclusionQueries", useOcclusionQueries); 
    2828 
     29#if SG08_HACK 
     30        // evaluate histogram of loaded pvs solution 
     31         
     32 
     33 
     34 
     35#endif 
     36         
     37         
     38 
     39         
    2940        Debug << "************* render sampler ****************" << endl; 
    3041        Debug << "threshold: " << threshold << endl; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r2635 r2638  
    33713371                        // $$ warning collect objects takes only unmailed ones! 
    33723372                        if (mUseKdPvs) { 
    3373                           //                      GetPreprocessor()->mKdTree->CollectKdObjects(box, objects); 
    3374                           GetPreprocessor()->mKdTree->CollectSmallKdObjects(box, objects, 0.02f); 
     3373                          GetPreprocessor()->mKdTree->CollectKdObjects(box, objects); 
     3374                          //GetPreprocessor()->mKdTree->CollectSmallKdObjects(box, objects, 0.02f); 
    33753375 
    33763376                        } else 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r2625 r2638  
    635635        VizBuffer mVizBuffer; 
    636636 
     637        /** Intersects box with the tree and returns the number of intersected boxes. 
     638                @returns number of view cells found 
     639        */ 
     640        virtual int ComputeBoxIntersections(const AxisAlignedBox3 &box,  
     641                                                                                ViewCellContainer &viewCells) const; 
    637642 
    638643protected: 
     
    649654                                                                  int rightIdx) const; 
    650655 
    651         /** Intersects box with the tree and returns the number of intersected boxes. 
    652                 @returns number of view cells found 
    653         */ 
    654         virtual int ComputeBoxIntersections(const AxisAlignedBox3 &box,  
    655                                                                                 ViewCellContainer &viewCells) const; 
    656656        /** Tests the visibility filter functionality. 
    657657        */ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/default.env

    r2635 r2638  
    185185        splitMethod SAH 
    186186        splitBorder 0.01 
    187         pvsArea 1e-3 
     187        pvsArea 1e-4 
    188188} 
    189189 
  • GTP/trunk/Lib/Vis/Preprocessing/src/run_test2

    r2636 r2638  
    44 
    55#COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 
    6 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=500000 -total_samples=20000000 -mutation_use_pass_importance- -mutation_silhouette_search_steps=3 -preprocessor_ray_cast_method=3 -preprocessor_detect_empty_viewspace+" 
     6COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=50000000 -samples_per_pass=1000000 -total_samples=20000000 -mutation_use_pass_importance- -mutation_silhouette_search_steps=3 -preprocessor_ray_cast_method=1 -preprocessor_detect_empty_viewspace+ -total_time=140" 
    77 
    88#SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d" 
     
    2929#VIEWCELLS=../data/test1/test-viewcells.xml 
    3030 
    31 #SCENE=../data/Arena/arena-high-lods.obj 
    32 #VIEWCELLS=../data/Arena/arena-high-lods-5000-viewcells.xml.gz 
     31SCENE=../data/Arena/arena-high-lods.obj 
     32VIEWCELLS=../data/Arena/arena-high-lods-5000-viewcells.xml.gz 
    3333#VIEWCELLS=../data/Arena/viewcells-5000.xml.gz 
    3434#VIEWCELLS=../data/Arena/arena-high-lods-57000-viewcells.xml.gz 
    3535 
    3636 
    37 SCENE=../data/vienna/vienna_cropped.obj 
    38 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 
     37# SCENE=../data/vienna/vienna_cropped.obj 
     38# VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 
     39#VIEWCELLS=../data/vienna/vienna_cropped-20000-viewcells.xml.gz 
    3940 
    4041#VIEWCELLS=../data/vienna/vienna-sequential-30000-single-viewcell.xml 
    4142 
    4243 
    43 # SCENE=../data/Pompeii/PompeiiTen.obj 
    44 # VIEWCELLS=../data/Pompeii/pompeii_big-seq-viewcells.xml.gz 
     44#SCENE=../data/Pompeii/PompeiiTen.obj 
     45#VIEWCELLS=../data/Pompeii/pompeii_big-seq-viewcells.xml.gz 
    4546 
    4647PREFIX=../work/plots/osp-TEST 
     
    5859 
    5960 
    60 $COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 
     61$COMMAND -preprocessor=sampling -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 
    6162-rss_distributions=mutation+object_direction+spatial \ 
     63-mutation_silhouette_prob=0.5 \ 
     64-mutation_reverse_samples_distance=1.0 \ 
     65-mutation_radius_origin=1.0 \ 
     66-mutation_radius_termination=0.2 \ 
     67-mutation_use_unsucc_count_importance+ \ 
     68-mutation_use_pass_importance- \ 
     69-mutation_buffer_size=2000000 \ 
    6270-view_cells_use_kd_pvs+ -af_use_kd_pvs+ -view_cells_filter_width=1.0 \ 
    6371-preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4a.xml \ 
Note: See TracChangeset for help on using the changeset viewer.