- Timestamp:
- 12/05/05 13:47:58 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r448 r451 19 19 20 20 Preprocessor { 21 # type sampling 22 type vss 21 type sampling 22 # type vss 23 # type rss 23 24 } 24 25 25 26 VssPreprocessor { 26 samplesPerPass 10000 27 initialSamples 20000028 vssSamples 100000 29 vssSamplesPerPass 1000027 samplesPerPass 100000 28 initialSamples 500000 29 vssSamples 1000000 30 vssSamplesPerPass 50000 30 31 useImportanceSampling true 31 32 } 32 33 34 33 35 VssTree { 36 useRss false 34 37 epsilon 1e-6 35 38 … … 38 41 minRays 100 39 42 minSize 0.001 40 maxCostRatio 0.9843 maxCostRatio 2.0 41 44 maxRayContribution 0.05 42 45 43 46 maxTotalMemory 200 44 maxStaticMemory 5047 maxStaticMemory 100 45 48 46 49 splitType regular 47 # splitType heuristics 50 # splitType heuristic 51 # splitType hybrid 52 splitUseOnlyDrivingAxis true 53 54 interleaveDirSplits false 55 dirSplitDepth 40 56 57 numberOfEndPointDomains 10000 58 ct_div_ci 0.0 59 randomize false 60 61 refDirBoxMaxSize 0.1 62 } 63 64 RssPreprocessor { 65 samplesPerPass 100000 66 initialSamples 500000 67 vssSamples 5000000 68 vssSamplesPerPass 100000 69 useImportanceSampling true 70 } 71 72 RssTree { 73 useRss false 74 epsilon 1e-6 75 76 maxDepth 40 77 minPvs 5 78 minRays 30 79 minSize 0.001 80 maxCostRatio 0.9 81 maxRayContribution 0.1 82 83 maxTotalMemory 200 84 maxStaticMemory 100 85 86 # splitType regular 87 # splitType heuristic 88 splitType hybrid 89 splitUseOnlyDrivingAxis false 90 91 interleaveDirSplits true 92 dirSplitDepth 9 48 93 49 94 numberOfEndPointDomains 10000 … … 229 274 } 230 275 231 VssTree {232 epsilon 1e-6233 234 maxDepth 40235 minPvs 100236 minRays 50237 minSize 0.00001238 maxCostRatio 0.95239 maxRayContribution 0.05240 241 maxTotalMemory 200242 maxStaticMemory 20243 244 splitType regular245 # splitType heuristics246 247 numberOfEndPointDomains 10000248 ct_div_ci 0.0249 randomize false250 251 refDirBoxMaxSize 0.1252 }253 276 254 277 VspKdTree { -
trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp
r450 r451 9 9 #include "VssRay.h" 10 10 #include "RssTree.h" 11 #include "ViewCell Bsp.h"11 #include "ViewCellsManager.h" 12 12 13 13 static bool useViewSpaceBox = true;//true; … … 378 378 int totalSamples = 0; 379 379 380 /// Rays used for post processing and visualizations. 381 RayContainer storedRays; 380 382 381 383 AxisAlignedBox3 *box = new AxisAlignedBox3(mKdTree->GetBox()); … … 407 409 RssTree *rssTree = NULL; 408 410 409 RayContainer bspRays;410 411 411 while (totalSamples < mInitialSamples) { 412 412 int passContributingSamples = 0; … … 423 423 Vector3 direction = GetDirection(viewpoint, mViewSpaceBox); 424 424 425 sampleContributions =CastRay(viewpoint, direction, mVssRays);425 CastRay(viewpoint, direction, mVssRays); 426 426 427 427 … … 473 473 ExportPvs("rss-pvs-initial.x3d", rssTree); 474 474 } 475 475 476 // construct view cells 477 mViewCellsManager->Construct(mObjects, mVssRays, mViewSpaceBox); 478 476 479 rssTree = new RssTree; 477 480 // viewcells = Construct(mVssRays); … … 550 553 } 551 554 555 //-- prepare traversal rays for view cell intersections 556 RayContainer passRays; 557 558 VssRayContainer::const_iterator it, it_end = vssRays.end(); 559 560 for (it = vssRays.begin(); it != it_end; ++ it) 561 passRays.push_back(new Ray(*(*it))); 562 563 int sampleContributions = 0; 564 int contributingSamples = 0; 565 566 /// compute view cell contribution of rays 567 mViewCellsManager->ComputeSampleContributions(passRays, 568 sampleContributions, 569 contributingSamples); 570 571 //-- save rays for post processing 572 if (((int)storedRays.size() < mViewCellsManager->GetPostProcessSamples()) || 573 ((int)storedRays.size() < mViewCellsManager->GetVisualizationSamples())) 574 { 575 RayContainer::const_iterator it, it_end = passRays.end(); 576 577 for (it = passRays.begin(); it != it_end; ++ it) 578 storedRays.push_back(new Ray(*(*it))); 579 } 580 else 581 { 582 CLEAR_CONTAINER(passRays); 583 } 584 552 585 samples+=num; 553 586 float pvs = rssTree->GetAvgPvsSize(); … … 575 608 } 576 609 577 void578 RssPreprocessor::CastRay(const BspTree &tree, const VssRay & vssRay)579 {580 //-- cast ray to BSP tree to get intersection with view cells581 Ray ray(vssRay);582 mBspTree->CastRay(ray);583 584 //if (0 && ray.sourceObject.mObject)585 //sampleContributions +=586 //AddObjectSamples(ray.sourceObject.mObject, ray);587 588 if (!ray.intersections.empty()) // second intersection found589 {590 //sampleContributions +=591 AddObjectSamples(ray.intersections[0].mObject, ray);592 }593 }594 595 int596 RssPreprocessor::AddObjectSamples(Intersectable *obj, const Ray &ray)597 {598 int contributingSamples = 0;599 int j;600 601 // object can be seen from the view cell => add to view cell pvs602 for (j=0; j < ray.bspIntersections.size(); ++ j)603 {604 BspLeaf *leaf = ray.bspIntersections[j].mLeaf;605 // if ray not in unbounded space606 /* if (leaf->GetViewCell() != &mUnbounded)607 contributingSamples +=608 leaf->GetViewCell()->GetPvs().AddSample(obj);*/609 }610 611 // rays passing through this viewcell612 if (mPass > 1)613 for (j=1; j < ((int)ray.bspIntersections.size() - 1); ++ j)614 {615 BspLeaf *leaf = ray.bspIntersections[j].mLeaf;616 617 /* if (leaf->GetViewCell() != &mUnbounded)618 leaf->GetViewCell()->619 AddPassingRay(ray, contributingSamples ? 1 : 0);*/620 }621 622 return contributingSamples;623 } -
trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.h
r450 r451 104 104 ); 105 105 106 void107 CastRay(const BspTree &tree, const VssRay & vssRay);108 109 int110 AddObjectSamples(Intersectable *obj, const Ray &ray);111 112 113 114 106 }; 115 107 -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r448 r451 361 361 362 362 float avgRayContrib = (passContributingSamples > 0) ? 363 passSampleContributions /(float)passContributingSamples : 0;363 passSampleContributions / (float)passContributingSamples : 0; 364 364 365 365 cout << "#Pass " << mPass << " : t = " << TimeDiff(startTime, GetTime())*1e-3 << "s" << endl; -
trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.cpp
r448 r451 489 489 int pass = 0; 490 490 491 /// Rays used for post processing and visualizations .491 /// Rays used for post processing and visualizations 492 492 RayContainer storedRays; 493 493 // cast view cell samples -
trunk/VUT/GtpVisibilityPreprocessor/src/default.env
r446 r451 144 144 145 145 ViewCells { 146 #hierarchy kdTree 147 hierarchy vspTree 148 #hierarchy bspTree 149 # hierarchy sceneDependent 146 loadFromFile false 147 #type kdTree 148 type vspKdTree 149 #type bspTree 150 #type vspBspTree 151 152 #type sceneDependent 150 153 151 154 height 5.0 … … 156 159 minPvs 10 157 160 maxPvs 150 158 samples 100000 159 } 160 161 # how much samples are used for post processing 162 samples 10 163 } 164 165 Visualization { 166 # how much samples are be used for visualization 167 samples 90000 168 } 161 169 162 170 # filename ../data/atlanta/atlanta_viewcells_large.x3d … … 168 176 BspTree { 169 177 Construction { 170 input fromSamples 171 # input fromViewCells 172 # input fromSceneGeometry 173 samples 150000 174 sideTolerance 0.005 178 samples 50000 179 epsilon 0.005 175 180 } 176 181 … … 209 214 #splitPlaneStrategy 130 210 215 211 splitPlaneStrategy 12 212 213 maxPolyCandidates 70 214 maxRayCandidates 100 216 splitPlaneStrategy 1024 217 218 maxPolyCandidates 50 219 maxRayCandidates 50 220 221 maxTests 10000 215 222 216 223 # factors for evaluating split plane costs … … 221 228 leastRaySplits 1.0 222 229 balancedRays 1.0 223 pvs Factor1.0230 pvs 1.0 224 231 leastSplits 1.0 225 232 balancedPolys 1.0 … … 232 239 minPolygons -1 233 240 maxDepth 40 234 minPvs 35241 minPvs 100 235 242 minArea 0.01 236 243 maxRayContribution 0.005 … … 258 265 # x3d visualization of the split planes 259 266 exportSplits true 260 # how much samples should be used in visualization261 samples 20000262 267 } 263 268 } … … 274 279 275 280 Construction { 276 samples 500000277 } 278 279 Termination { 280 maxDepth 30281 minPvs 60281 samples 100000 282 } 283 284 Termination { 285 maxDepth 40 286 minPvs 50 282 287 minRays 1 283 288 minSize 0.1 … … 286 291 } 287 292 288 maxTotalMemory 600289 maxStaticMemory 600293 maxTotalMemory 400 294 maxStaticMemory 200 290 295 291 296 splitType regular … … 293 298 ct_div_ci 0.0 294 299 } 300 301 VspBspTree { 302 Construction { 303 samples 100000 304 epsilon 0.005 305 } 306 307 308 # random polygon = 1 309 # axis aligned = 2 310 # least ray splits = 256 311 # balanced rays = 512 312 # pvs = 1024 313 314 splitPlaneStrategy 1024 315 316 # maximal candidates for split planes 317 maxPolyCandidates 50 318 maxRayCandidates 50 319 320 # maximal tested rays for split cost heuristics 321 maxTests 10000 322 323 # factors for evaluating split plane costs 324 Factor { 325 leastRaySplits 1.0 326 balancedRays 1.0 327 pvs 1.0 328 } 329 330 Termination { 331 # parameters used for autopartition 332 minRays 200 333 minPolygons -1 334 maxDepth 40 335 minPvs 100 336 minArea 0.01 337 maxRayContribution 0.005 338 #maxAccRayLength 100 339 340 # used for pvs criterium 341 ct_div_ci 0.0 342 343 # axis aligned splits 344 AxisAligned { 345 minPolys 5000 346 minRays 500 347 minObjects 10 348 maxCostRatio 0.9 349 ct_div_ci 0.5 350 } 351 } 352 353 AxisAligned { 354 splitBorder 0.01 355 } 356 357 358 Visualization { 359 # x3d visualization of the split planes 360 exportSplits true 361 } 362 }
Note: See TracChangeset
for help on using the changeset viewer.