Changeset 599


Ignore:
Timestamp:
02/06/06 02:16:36 (18 years ago)
Author:
bittner
Message:

slider visualization

Location:
trunk/VUT/GtpVisibilityPreprocessor/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp

    r591 r599  
    15451545                                   "false"); 
    15461546         
     1547        RegisterOption("Preprocessor.quitOnFinish", 
     1548                                   optBool, 
     1549                                   "quitOnFinish", 
     1550                                   "true"); 
    15471551 
    15481552        /**************************************************************************************/ 
  • trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.cpp

    r589 r599  
    103103  if (vc->GetMesh()) { 
    104104 
    105         if (vc->GetValid())  
    106           glColor3f(0,1,0); 
    107         else 
    108           glColor3f(0,0,1); 
     105        if (!mUseFalseColors) { 
     106          if (vc->GetValid())  
     107                glColor3f(0,1,0); 
     108          else 
     109                glColor3f(0,0,1); 
     110        } 
    109111         
    110112        RenderMesh(vc->GetMesh()); 
    111   } 
    112 } 
     113  } else { 
     114        // render viewcells in the subtree 
     115        if (!vc->IsLeaf()) { 
     116          ViewCellInterior *vci = (ViewCellInterior *) vc; 
     117 
     118          ViewCellContainer::iterator it = vci->mChildren.begin(); 
     119          for (; it != vci->mChildren.end(); ++it) { 
     120                RenderViewCell(*it); 
     121          } 
     122        } 
     123  } 
     124} 
     125 
    113126 
    114127void 
     
    684697GlRendererWidget::paintGL() 
    685698{ 
    686   RenderErrors(); 
    687   RenderInfo(); 
     699  if (mRenderViewCells) 
     700        RenderViewCells(); 
     701  else { 
     702        RenderErrors(); 
     703        RenderInfo(); 
     704  } 
     705   
    688706  mFrame++; 
    689707} 
     
    720738        updateGL(); 
    721739        break; 
     740  case Qt::Key_V: 
     741        mRenderViewCells = !mRenderViewCells; 
     742        updateGL(); 
     743        break; 
    722744  default: 
    723745        e->ignore(); 
     
    727749} 
    728750 
     751GlRendererWidget::GlRendererWidget(SceneGraph *sceneGraph, 
     752                                                                   ViewCellsManager *viewcells, 
     753                                                                   KdTree *tree, 
     754                                                                   QWidget * parent, 
     755                                                                   const QGLWidget * shareWidget, 
     756                                                                   Qt::WFlags f 
     757                                                                   ) 
     758  : 
     759  GlRenderer(sceneGraph, viewcells, tree), QGLWidget(parent, shareWidget, f) 
     760{ 
     761  mTopView = false; 
     762  mRenderViewCells = false; 
     763 
     764  QSlider *slider = new QSlider(this); 
     765  slider->show(); 
     766  slider->setRange(1, 10000); 
     767 
     768  connect(slider, SIGNAL(valueChanged(int)), this, SLOT(SetViewcellGranularity(int))); 
     769} 
     770 
     771void 
     772GlRendererWidget::SetViewcellGranularity(int number) 
     773{ 
     774  mViewCellsManager->CollectViewCells(number); 
     775  updateGL(); 
     776} 
     777 
     778void 
     779GlRendererWidget::RenderViewCells() 
     780{ 
     781  mUseFalseColors = true; 
     782 
     783  SetupCamera(); 
     784  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
     785 
     786  int i; 
     787  ViewCellContainer &viewcells = mViewCellsManager->GetViewCells(); 
     788  for (i=0; i < viewcells.size(); i++) { 
     789        ViewCell *vc = viewcells[i]; 
     790        Mesh *m = vc->GetMesh(); 
     791        float r = RandomValue(0.5, 1.0); 
     792        float g = RandomValue(0.5, 1.0); 
     793        float b = RandomValue(0.5, 1.0); 
     794 
     795        glColor3f(r, g, b); 
     796        //SetupMaterial(m->mMaterial); 
     797 
     798        RenderViewCell(vc); 
     799  } 
     800 
     801} 
    729802 
    730803void GlRendererBuffer::SampleBeamContributions(Intersectable *sourceObject, 
  • trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.h

    r589 r599  
    189189 
    190190  bool mTopView; 
     191  bool mRenderViewCells; 
    191192   
    192193  GlRendererWidget(SceneGraph *sceneGraph, 
     
    194195                                   KdTree *tree, 
    195196                                   QWidget * parent = 0, const QGLWidget * shareWidget = 0, Qt::WFlags f = 0 
    196                                    ): 
    197         GlRenderer(sceneGraph, viewcells, tree), QGLWidget(parent, shareWidget, f) 
    198   { 
    199         mTopView = false; 
    200   } 
     197                                   ); 
     198 
    201199 
    202200  virtual void SetupCamera(); 
     
    224222  virtual int GetWidth() const { return width(); } 
    225223  virtual int GetHeight() const { return height(); } 
     224 
     225 
     226  void 
     227  RenderViewCells(); 
     228 
     229 public slots: 
     230 void 
     231 SetViewcellGranularity(int number); 
     232 
     233 
    226234}; 
    227235 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp

    r577 r599  
    2828   
    2929  environment->GetBoolValue("Preprocessor.useGlDebugger", mUseGlDebugger); 
     30  environment->GetBoolValue("Preprocessor.quitOnFinish", mQuitOnFinish); 
     31 
    3032} 
    3133 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.h

    r577 r599  
    156156   
    157157  bool mDetectEmptyViewSpace; 
    158    
     158 
     159  bool mQuitOnFinish; 
    159160protected: 
    160161 
  • trunk/VUT/GtpVisibilityPreprocessor/src/PreprocessorThread.cpp

    r576 r599  
    1313{ 
    1414  mPreprocessor = p; 
    15   connect(this, SIGNAL(finished()), qApp, SLOT(closeAllWindows(void))); 
     15  if (p->mQuitOnFinish) 
     16        connect(this, SIGNAL(finished()), qApp, SLOT(closeAllWindows(void))); 
    1617} 
    1718 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.h

    r592 r599  
    353353 
    354354         
     355   
     356  void CollectViewCells(const int n) { 
     357        mNumMergedViewCells = n; 
     358        mViewCells.clear(); 
     359        CollectViewCells(); 
     360  } 
     361 
    355362 
    356363protected: 
  • trunk/VUT/GtpVisibilityPreprocessor/src/default.env

    r576 r599  
    1313#;../data/vienna/vienna-plane.x3d 
    1414# filename ../data/vienna/viewcells-25-sel.x3d 
    15 filename ../data/atlanta/atlanta2.x3d 
     15#filename ../data/atlanta/atlanta2.x3d 
    1616#filename ../data/soda/soda.dat 
    17 # filename ../data/soda/soda5.dat 
     17filename ../data/soda/soda5.dat 
    1818} 
    1919 
     
    2727        detectEmptyViewSpace false 
    2828        pvsRenderErrorSamples 10000 
     29        quitOnFinish false 
    2930} 
    3031 
     
    7273RssPreprocessor { 
    7374        samplesPerPass 500000 
    74         initialSamples 2000000 
    75         vssSamples 20000000 
     75        initialSamples 100 
     76        vssSamples 100 
    7677        vssSamplesPerPass 1000000 
    7778        useImportanceSampling true 
     
    166167 
    167168ViewCells { 
    168         loadFromFile true 
     169        # samples used for view cell construction 
     170        Construction { 
     171                samples 600000 
     172                samplesPerPass 200000 
     173        } 
     174 
     175        #number of active view cells 
     176        active 10000 
     177        maxStaticMemory 40 
     178 
    169179        exportToFile false 
     180        loadFromFile false 
     181 
    170182        #type kdTree 
    171183        #type vspKdTree 
     
    177189        height 5.0 
    178190        maxViewCells 100000 
     191 
    179192        #percentage of total visible objects where pvs is considered invalid 
    180         maxPvsRatio 0.05 
     193        maxPvsRatio 1.0 
    181194                 
    182         delayedConstruction true 
    183                  
    184                  
     195        pruneEmptyViewCells false 
     196        processOnlyValidViewCells false 
     197         
    185198        PostProcess { 
    186199                # how much samples are used for post processing 
    187                 samples 200000 
     200                samples 300000 
     201                renderCostWeight 1.0 
     202                maxCostRatio 0.1 
     203                minViewCells 1 
     204                avgCostMaxDeviation 0.8 
     205                maxMergesPerPass 500  
     206                useRaysForMerge false 
     207                refine false 
     208                compress false 
     209                merge true 
    188210        } 
    189211 
    190212        Visualization { 
    191213                # how much samples we use for visualization 
    192                 samples 5000 
     214                samples 100000 
    193215                #colorCode PVS 
    194216                #colorCode MergedLeaves 
    195217                #colorCode MergedTreeDiff 
    196218                colorCode Random 
    197                 exportRays false 
    198                 exportGeometry false 
    199         } 
    200          
    201 #       filename ../data/soda/viewcells_soda5-2.xml 
    202         filename ../data/atlanta/viewcells_atlanta2.xml 
     219                exportRays true 
     220                exportGeometry true 
     221                exportMergedViewCells true 
     222                useCuttingPlane true 
     223                cuttingPlaneAxis 1 
     224        } 
     225         
    203226#       filename ../data/atlanta/atlanta_viewcells_large.x3d 
    204227#       filename ../data/vienna/viewcells-25-sel.x3d 
     
    206229#       filename ../data/vienna/viewcells-large-sel.x3d 
    207230#       filename ../scripts/viewcells_vienna.xml 
    208  
    209  
     231        filename ../scripts/viewcells_atlanta.xml 
    210232} 
    211233 
     
    217239        moveSpeed 0.0001 
    218240} 
     241 
    219242 
    220243 
     
    257280 
    258281 
     282 
    259283VspBspTree { 
    260284        Construction { 
    261                 samples 500000 
     285                samples 300000 
    262286                epsilon 0.005 
    263287                randomize false 
     288                renderCostWeight 1.0 
    264289        } 
    265290 
     
    270295        # balanced rays        = 512 
    271296        # pvs                  = 1024 
    272  
     297         
    273298        splitPlaneStrategy 1024 
    274299         
    275300        # maximal candidates for split planes 
    276         maxPolyCandidates 100 
    277         maxRayCandidates 100 
     301        maxPolyCandidates 0 
     302 
    278303         
    279304        # maximal tested rays for split cost heuristics 
    280         maxTests 2000 
     305        maxTests 10000 
     306         
     307        maxTotalMemory  50 
     308        maxStaticMemory 50 
    281309         
    282310        # factors for evaluating split plane costs 
     
    287315        } 
    288316         
    289 #       Termination { 
    290 #               # parameters used for autopartition 
    291 #               minRays                 100 
    292 #               minPolygons             -1 
    293 #               maxDepth                30 
    294 #               minPvs                  2 
    295 #               #minProbability         0.0001 
    296 #               minProbabilty           0.000 
    297 #               maxRayContribution      0.005 
     317        Termination { 
     318                # parameters used for autopartition 
     319                minRays                 -150 
     320                minPolygons             -1 
     321                maxDepth                30 
     322                minPvs                  -10 
     323                #minProbability         0.0001 
     324                minProbability          -1 
     325#               maxRayContribution      0.3 
     326                maxRayContribution      2.3 
    298327#               maxCostRatio            0.9 
    299 #               missTolerance           4 
    300 #               #maxAccRayLength        100 
     328                maxCostRatio            3.9 
     329                missTolerance           3 
     330 
    301331                 
    302 #               maxViewCells            20000 
     332                maxViewCells            10000 
    303333                 
    304 #               # used for pvs criterium 
    305 #               ct_div_ci 0.0 
    306 #       } 
    307          
    308         splitUseOnlyDrivingAxis false 
     334                # used for pvs criterium 
     335                ct_div_ci 0.0 
     336                 
     337                AxisAligned { 
     338                        minRays                 1 
     339                        maxRayContribution      9.9 
     340                } 
     341        } 
     342         
     343        splitUseOnlyDrivingAxis true 
    309344         
    310345        Visualization { 
     
    312347                exportSplits true 
    313348        } 
    314          
    315 } 
     349} 
Note: See TracChangeset for help on using the changeset viewer.