- Timestamp:
- 01/29/07 19:00:03 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env
r2064 r2065 6 6 Scene { 7 7 # filename ../data/vienna/vienna_cropped.obj 8 filename ../data/soda/soda5. dat8 filename ../data/soda/soda5.obj 9 9 } 10 10 11 11 12 12 Preprocessor { 13 samplesPerPass 3000000 13 14 useGlRenderer false 14 15 type vss 15 16 detectEmptyViewSpace true 17 #loadMeshes true 16 18 loadMeshes false 17 19 # internal raycaster … … 84 86 maxDepth 20 85 87 86 maxCostRatio 1.588 maxCostRatio 2.5 87 89 ct_div_ci 0.5 88 90 } … … 92 94 splitBorder 0.01 93 95 } 96 94 97 95 98 MeshKdTree { … … 151 154 Visualization { 152 155 # how much samples we use for visualization 153 samples 0156 samples 20000 154 157 exportRays true 155 158 exportGeometry true … … 184 187 VspBspTree { 185 188 Construction { 186 samples 500000189 samples 300000 187 190 epsilon 0.0000001 188 191 randomize false -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r2048 r2065 740 740 { 741 741 cout << "bvh local termination criteria met:" << endl; 742 cout << "objects: " << (int)tData.mNode->mObjects.size() << " " << mTermMinObjects<< endl;742 cout << "objects: " << (int)tData.mNode->mObjects.size() << " (" << mTermMinObjects << ")" << endl; 743 743 } 744 744 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp
r2017 r2065 150 150 SetFilled(); 151 151 152 if ( 0)152 if (1) 153 153 ExportGeometry(leaf->mObjects, true, box); 154 154 else -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2053 r2065 1313 1313 } 1314 1314 1315 cout << "here5" << endl; 1316 1315 1317 DeterminePvsObjects(vssRays); 1316 1318 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.cpp
r2017 r2065 143 143 Intersectable::NewMail(); 144 144 KdLeaf::NewMail(); 145 BvhNode::NewMail(); 145 146 cout << "here55 " << GetSize() << endl; 146 147 147 148 ObjectPvsEntries::const_iterator it, it_end = mEntries.end(); … … 161 162 } 162 163 case Intersectable::BVH_INTERSECTABLE: 163 { 164 {cout<< "i"; 164 165 BvhNode *bvhObj = static_cast<BvhNode *>(obj); 165 166 pvs += EvalBvhNodeContribution(bvhObj); … … 172 173 } 173 174 175 cout << "here44 " << pvs << endl; 174 176 return pvs; 175 177 } -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2064 r2065 742 742 vector<int>::const_iterator iit, iit_end = strategies.end(); 743 743 744 cout << "===============================\n" << endl; 744 745 for (iit = strategies.begin(); iit != iit_end; ++ iit) 745 746 { … … 762 763 << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 763 764 765 cout << "===============================\n" << endl; 764 766 return (int)passSamples.size(); 765 767 } … … 1810 1812 { 1811 1813 1812 if ((vc->GetPvs().EvalPvsCost() > maxPvsSize) || 1813 (vc->GetPvs().EvalPvsCost() < minPvsSize)) 1814 { 1814 const float pvsCost = vc->GetPvs().EvalPvsCost(); 1815 1816 if ((pvsCost > maxPvsSize) || (pvsCost < minPvsSize)) 1817 { 1818 cout << "err: " << pvsCost << " " << minPvsSize << " " << maxPvsSize << endl; 1815 1819 return false; 1816 1820 } … … 2687 2691 const bool useHitObjects) 2688 2692 { 2689 if (!useHitObjects) { 2690 VssRayContainer::const_iterator it, it_end = rays.end(); 2691 for (it = rays.begin(); it != it_end; ++ it) { 2692 VssRay *vssRay = *it; 2693 // set only the termination object 2694 vssRay->mTerminationObject = GetIntersectable( 2695 *vssRay, 2696 true); 2697 } 2698 } 2693 if (!useHitObjects) 2694 { 2695 VssRayContainer::const_iterator it, it_end = rays.end(); 2696 2697 for (it = rays.begin(); it != it_end; ++ it) 2698 { 2699 VssRay *vssRay = *it; 2700 // set only the termination object 2701 vssRay->mTerminationObject = GetIntersectable( 2702 *vssRay, 2703 true); 2704 } 2705 } 2699 2706 } 2700 2707 … … 2756 2763 2757 2764 if (!GetViewSpaceBox().GetRaySegment(hray, tmin, tmax) || (tmin > tmax)) { 2758 // 2765 // cerr<<"ray outside view space box\n"; 2759 2766 return 0; 2760 2767 } … … 2785 2792 if (storeViewCells) 2786 2793 { 2787 cerr<<"Store viewcells should not be used in the test!"<<endl;2794 // cerr << "Store viewcells should not be used in the test!" << endl; 2788 2795 // copy viewcells memory efficiently 2789 2796 #if VSS_STORE_VIEWCELLS … … 5320 5327 { 5321 5328 cout << "exporting view cells after post process ... "; 5329 5322 5330 if (0) 5323 5331 { // export view space box … … 6306 6314 if (!node->IsLeaf()) 6307 6315 { 6308 cout << "error, can only doleaves" << endl;6316 cout << "error, can only process leaves" << endl; 6309 6317 return 0; 6310 6318 } … … 6372 6380 const int savedColorCode = mColorCode; 6373 6381 6374 const float maxRenderCost = UpdateObjectCosts();6382 const float maxRenderCost = -1;//UpdateObjectCosts(); 6375 6383 cout << "maxRenderCost: " << maxRenderCost << endl; 6376 6384 mColorCode = 0; // 0 = random, 1 = export pvs 6377 6378 if (0)6379 mHierarchyManager->ExportObjectSpaceHierarchy(exporter, objects,6380 CLAMP_TO_BOX ? &bbox : NULL, maxRenderCost, false);6381 6382 6383 //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane());6384 ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane());6385 6386 delete exporter;6387 6388 cout << "finished in " << TimeDiff(starttime, GetTime()) * 1e-3f << " secs" << endl;6389 mColorCode = savedColorCode;6390 }6391 6392 exporter = Exporter::GetExporter("final_object_partition.wrl");6393 6394 if (exporter)6395 {6396 if (CLAMP_TO_BOX)6397 {6398 exporter->mClampToBox = true;6399 }6400 6401 EvaluateViewCellsStats();6402 6403 const long starttime = GetTime();6404 cout << "exporting final objects (after initial construction + post process) ... ";6405 6406 // matt: hack for clamping scene6407 AxisAlignedBox3 bbox = mViewSpaceBox;6408 bbox.Scale(scale);6409 6410 // hack color code (show pvs size)6411 const int savedColorCode = mColorCode;6412 6413 mColorCode = 1; // 0 = random, 1 = export pvs6414 // don't visualize render cost6415 const float maxRenderCost = -1;6416 6385 6417 6386 if (1) … … 6420 6389 6421 6390 6422 //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 6423 if (0) 6391 if (1) 6392 { 6393 //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 6424 6394 ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 6395 } 6396 6397 delete exporter; 6398 6399 cout << "finished in " << TimeDiff(starttime, GetTime()) * 1e-3f << " secs" << endl; 6400 mColorCode = savedColorCode; 6401 } 6402 6403 exporter = Exporter::GetExporter("final_object_partition.wrl"); 6404 6405 if (exporter) 6406 { 6407 if (CLAMP_TO_BOX) 6408 { 6409 exporter->mClampToBox = true; 6410 } 6411 6412 EvaluateViewCellsStats(); 6413 6414 const long starttime = GetTime(); 6415 cout << "exporting final objects (after initial construction + post process) ... "; 6416 6417 // matt: hack for clamping scene 6418 AxisAlignedBox3 bbox = mViewSpaceBox; 6419 bbox.Scale(scale); 6420 6421 // hack color code (show pvs size) 6422 const int savedColorCode = mColorCode; 6423 6424 mColorCode = 1; // 0 = random, 1 = export pvs 6425 // don't visualize render cost 6426 const float maxRenderCost = -1; 6427 6428 if (1) 6429 mHierarchyManager->ExportObjectSpaceHierarchy(exporter, objects, 6430 CLAMP_TO_BOX ? &bbox : NULL, maxRenderCost, false); 6431 6432 6433 if (1) 6434 { 6435 ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 6436 //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 6437 } 6425 6438 6426 6439 delete exporter; -
GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
r2063 r2065 406 406 else 407 407 { 408 while (totalSamples < mInitialSamples) { 408 while (totalSamples < mInitialSamples) 409 { 409 410 int passContributingSamples = 0; 410 411 int passSampleContributions = 0; … … 477 478 ExportSamples(mVssRays); 478 479 cout << "finished\n" << endl; 479 480 /*VssRayContainer dummyRays;481 LoadSamples(dummyRays, mObjects);482 Debug << "rays " << (int)mVssRays.size() << " " << dummyRays.size() << endl;483 484 for (int i = 0; i < (int)mVssRays.size(); ++ i)485 {486 Debug << mVssRays[i]->GetOrigin() << " " << mVssRays[i]->GetTermination() << " " << mVssRays[i]->mOriginObject << " " << mVssRays[i]->mTerminationObject << endl;487 Debug << dummyRays[i]->GetOrigin() << " " << dummyRays[i]->GetTermination() << " " << dummyRays[i]->mOriginObject << " " << dummyRays[i]->mTerminationObject << endl << endl;488 }*/489 480 } 490 481 … … 519 510 // get viewcells as kd tree boxes 520 511 vector<AxisAlignedBox3> kdViewcells; 521 if (0) { 512 if (0) 513 { 522 514 vector<KdLeaf *> leaves; 523 515 mKdTree->CollectLeaves(leaves); … … 541 533 while (samples < mVssSamples) 542 534 { 543 544 535 int num = mVssSamplesPerPass; 545 536 SimpleRayContainer rays; 546 537 VssRayContainer vssRays; 547 538 548 if (!mUseImportanceSampling) { 539 if (!mUseImportanceSampling) 540 { 549 541 for (int j=0; j < num; j++) { 550 542 Vector3 viewpoint; … … 556 548 ); 557 549 } 558 } else { 550 } 551 else 552 { 559 553 num = GenerateImportanceRays(vssTree, num, rays); 560 554 } … … 563 557 vssTree->AddRays(vssRays); 564 558 565 if (0) { 559 if (0) 560 { 566 561 int subdivided = vssTree->UpdateSubdivision(); 567 562 cout<<"subdivided leafs = "<<subdivided<<endl; … … 584 579 } 585 580 586 samples+=num; 581 samples += num; 582 587 583 float pvs = vssTree->GetAvgPvsSize(); 588 584 cout<<"*****************************\n"; … … 627 623 void VssPreprocessor::DeterminePvsObjects(VssRayContainer &rays) 628 624 { 625 //Preprocessor::DeterminePvsObjects(rays); 626 627 cout << "here4"; 629 628 mViewCellsManager->DeterminePvsObjects(rays, true); 630 629 }
Note: See TracChangeset
for help on using the changeset viewer.