Changeset 599 for trunk/VUT/GtpVisibilityPreprocessor
- Timestamp:
- 02/06/06 02:16:36 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp
r591 r599 1545 1545 "false"); 1546 1546 1547 RegisterOption("Preprocessor.quitOnFinish", 1548 optBool, 1549 "quitOnFinish", 1550 "true"); 1547 1551 1548 1552 /**************************************************************************************/ -
trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.cpp
r589 r599 103 103 if (vc->GetMesh()) { 104 104 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 } 109 111 110 112 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 113 126 114 127 void … … 684 697 GlRendererWidget::paintGL() 685 698 { 686 RenderErrors(); 687 RenderInfo(); 699 if (mRenderViewCells) 700 RenderViewCells(); 701 else { 702 RenderErrors(); 703 RenderInfo(); 704 } 705 688 706 mFrame++; 689 707 } … … 720 738 updateGL(); 721 739 break; 740 case Qt::Key_V: 741 mRenderViewCells = !mRenderViewCells; 742 updateGL(); 743 break; 722 744 default: 723 745 e->ignore(); … … 727 749 } 728 750 751 GlRendererWidget::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 771 void 772 GlRendererWidget::SetViewcellGranularity(int number) 773 { 774 mViewCellsManager->CollectViewCells(number); 775 updateGL(); 776 } 777 778 void 779 GlRendererWidget::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 } 729 802 730 803 void GlRendererBuffer::SampleBeamContributions(Intersectable *sourceObject, -
trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.h
r589 r599 189 189 190 190 bool mTopView; 191 bool mRenderViewCells; 191 192 192 193 GlRendererWidget(SceneGraph *sceneGraph, … … 194 195 KdTree *tree, 195 196 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 201 199 202 200 virtual void SetupCamera(); … … 224 222 virtual int GetWidth() const { return width(); } 225 223 virtual int GetHeight() const { return height(); } 224 225 226 void 227 RenderViewCells(); 228 229 public slots: 230 void 231 SetViewcellGranularity(int number); 232 233 226 234 }; 227 235 -
trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp
r577 r599 28 28 29 29 environment->GetBoolValue("Preprocessor.useGlDebugger", mUseGlDebugger); 30 environment->GetBoolValue("Preprocessor.quitOnFinish", mQuitOnFinish); 31 30 32 } 31 33 -
trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.h
r577 r599 156 156 157 157 bool mDetectEmptyViewSpace; 158 158 159 bool mQuitOnFinish; 159 160 protected: 160 161 -
trunk/VUT/GtpVisibilityPreprocessor/src/PreprocessorThread.cpp
r576 r599 13 13 { 14 14 mPreprocessor = p; 15 connect(this, SIGNAL(finished()), qApp, SLOT(closeAllWindows(void))); 15 if (p->mQuitOnFinish) 16 connect(this, SIGNAL(finished()), qApp, SLOT(closeAllWindows(void))); 16 17 } 17 18 -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.h
r592 r599 353 353 354 354 355 356 void CollectViewCells(const int n) { 357 mNumMergedViewCells = n; 358 mViewCells.clear(); 359 CollectViewCells(); 360 } 361 355 362 356 363 protected: -
trunk/VUT/GtpVisibilityPreprocessor/src/default.env
r576 r599 13 13 #;../data/vienna/vienna-plane.x3d 14 14 # filename ../data/vienna/viewcells-25-sel.x3d 15 filename ../data/atlanta/atlanta2.x3d15 #filename ../data/atlanta/atlanta2.x3d 16 16 #filename ../data/soda/soda.dat 17 #filename ../data/soda/soda5.dat17 filename ../data/soda/soda5.dat 18 18 } 19 19 … … 27 27 detectEmptyViewSpace false 28 28 pvsRenderErrorSamples 10000 29 quitOnFinish false 29 30 } 30 31 … … 72 73 RssPreprocessor { 73 74 samplesPerPass 500000 74 initialSamples 200000075 vssSamples 2000000075 initialSamples 100 76 vssSamples 100 76 77 vssSamplesPerPass 1000000 77 78 useImportanceSampling true … … 166 167 167 168 ViewCells { 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 169 179 exportToFile false 180 loadFromFile false 181 170 182 #type kdTree 171 183 #type vspKdTree … … 177 189 height 5.0 178 190 maxViewCells 100000 191 179 192 #percentage of total visible objects where pvs is considered invalid 180 maxPvsRatio 0.05193 maxPvsRatio 1.0 181 194 182 delayedConstruction true183 184 195 pruneEmptyViewCells false 196 processOnlyValidViewCells false 197 185 198 PostProcess { 186 199 # 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 188 210 } 189 211 190 212 Visualization { 191 213 # how much samples we use for visualization 192 samples 5000214 samples 100000 193 215 #colorCode PVS 194 216 #colorCode MergedLeaves 195 217 #colorCode MergedTreeDiff 196 218 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 203 226 # filename ../data/atlanta/atlanta_viewcells_large.x3d 204 227 # filename ../data/vienna/viewcells-25-sel.x3d … … 206 229 # filename ../data/vienna/viewcells-large-sel.x3d 207 230 # filename ../scripts/viewcells_vienna.xml 208 209 231 filename ../scripts/viewcells_atlanta.xml 210 232 } 211 233 … … 217 239 moveSpeed 0.0001 218 240 } 241 219 242 220 243 … … 257 280 258 281 282 259 283 VspBspTree { 260 284 Construction { 261 samples 500000285 samples 300000 262 286 epsilon 0.005 263 287 randomize false 288 renderCostWeight 1.0 264 289 } 265 290 … … 270 295 # balanced rays = 512 271 296 # pvs = 1024 272 297 273 298 splitPlaneStrategy 1024 274 299 275 300 # maximal candidates for split planes 276 maxPolyCandidates 100277 maxRayCandidates 100 301 maxPolyCandidates 0 302 278 303 279 304 # maximal tested rays for split cost heuristics 280 maxTests 2000 305 maxTests 10000 306 307 maxTotalMemory 50 308 maxStaticMemory 50 281 309 282 310 # factors for evaluating split plane costs … … 287 315 } 288 316 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 298 327 # maxCostRatio 0.9 299 # missTolerance 4 300 # #maxAccRayLength 100 328 maxCostRatio 3.9 329 missTolerance 3 330 301 331 302 # maxViewCells 20000332 maxViewCells 10000 303 333 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 309 344 310 345 Visualization { … … 312 347 exportSplits true 313 348 } 314 315 } 349 }
Note: See TracChangeset
for help on using the changeset viewer.