Changeset 1737 for GTP/trunk/Lib/Vis
- Timestamp:
- 11/09/06 19:41:31 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1736 r1737 2421 2421 void BvHierarchy::CollectObjects(const AxisAlignedBox3 &box, ObjectContainer &objects) 2422 2422 { 2423 stack<BvhNode *> nodeStack; 2424 2425 nodeStack.push(mRoot); 2426 2427 while (!nodeStack.empty()) 2428 { 2429 BvhNode *node = nodeStack.top(); 2430 2431 nodeStack.pop(); 2432 2433 if (node->IsLeaf()) 2434 { 2435 BvhLeaf *leaf = (BvhLeaf *)node; 2436 2437 ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 2438 2439 for (oit = leaf->mObjects.begin(); oit != oit_end; ++oit) 2440 { 2441 Intersectable *object = *oit; 2442 if (Overlap(box, object->GetBox())) 2443 { 2444 object->Mail(); 2445 objects.push_back(object); 2446 } 2423 stack<BvhNode *> nodeStack; 2424 2425 nodeStack.push(mRoot); 2426 2427 while (!nodeStack.empty()) 2428 { 2429 BvhNode *node = nodeStack.top(); 2430 2431 nodeStack.pop(); 2432 2433 if (node->IsLeaf()) 2434 { 2435 BvhLeaf *leaf = (BvhLeaf *)node; 2436 if (Overlap(box, leaf->GetBoundingBox())) { 2437 Intersectable *object = GetOrCreateBvhIntersectable(leaf); 2438 if (!object->Mailed()) { 2439 object->Mail(); 2440 objects.push_back(object); 2447 2441 } 2442 } 2448 2443 } 2449 2450 { 2451 2452 2453 2454 2455 2456 2457 2458 } 2459 } 2460 } 2461 2462 } 2444 else 2445 { 2446 BvhInterior *interior = (BvhInterior *)node; 2447 2448 if (Overlap(box, interior->GetBoundingBox())) 2449 nodeStack.push(interior->GetFront()); 2450 2451 if (Overlap(box, interior->GetBoundingBox())) 2452 nodeStack.push(interior->GetBack()); 2453 } 2454 } 2455 } 2456 2457 } -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r1608 r1737 176 176 glEnd(); 177 177 } 178 179 178 180 179 181 void -
GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.cpp
r1694 r1737 3 3 #include "Triangle3.h" 4 4 #include "KdTree.h" 5 #include "BvHierarchy.h" 5 6 6 7 … … 97 98 } 98 99 100 AxisAlignedBox3 BvhIntersectable::GetBox() const 101 { 102 return mItem->GetBoundingBox(); 99 103 } 104 105 } -
GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.h
r1707 r1737 179 179 return Intersectable::BVH_INTERSECTABLE; 180 180 } 181 182 AxisAlignedBox3 GetBox() const; 183 181 184 }; 182 185 -
GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
r1715 r1737 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1.2) on: st 1. XI 14:21:3020063 # Generated by qmake (2.00a) (Qt 4.1.2) on: ?t 9. XI 13:27:58 2006 4 4 # Project: preprocessor.pro 5 5 # Template: app -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
r1736 r1737 298 298 template <typename T, typename S> void Pvs<T, S>::Merge(const Pvs<T, S> &a) 299 299 { 300 std::map<T, S, LtSample<T> >::const_iterator it; 301 302 for (it = a.mEntries.begin(); it != a.mEntries.end(); ++ it) 303 { 304 AddSample((*it).first, (*it).second.mSumPdf); 305 } 300 301 std::map<T, S, LtSample<T> >::const_iterator it; 302 int samples = mSamples + a.mSamples; 303 304 for (it = a.mEntries.begin(); it != a.mEntries.end(); ++ it) 305 { 306 AddSample((*it).first, (*it).second.mSumPdf); 307 } 308 mSamples = samples; 306 309 } 307 310 … … 446 449 int Pvs<T, S>::AddPvs(const Pvs<T, S> &pvs) 447 450 { 448 mSamples +=pvs.mSamples;451 int samples = mSamples + pvs.mSamples; 449 452 std::map<T, S, LtSample<T> >:: 450 453 const_iterator it, it_end = pvs.mEntries.end(); … … 456 459 AddSample((*it).first, (*it).second.mSumPdf, contri); 457 460 } 458 461 462 mSamples = samples; 463 459 464 return GetSize(); 460 465 } … … 463 468 int Pvs<T, S>::SubtractPvs(const Pvs<T, S> &pvs) 464 469 { 465 mSamples -= pvs.mSamples; 470 471 int samples = mSamples - pvs.mSamples; 466 472 std::map<T, S, LtSample<T> >:: 467 473 const_iterator it, it_end = pvs.mEntries.end(); … … 470 476 for (it = pvs.mEntries.begin(); it != it_end; ++ it) 471 477 RemoveSample((*it).first, (*it).second.mSumPdf); 472 478 479 mSamples = samples; 473 480 return GetSize(); 474 481 } -
GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer.cpp
r1715 r1737 947 947 } 948 948 949 949 950 void 950 951 QtGlRendererWidget::RenderPvs() … … 970 971 971 972 if (mUseSpatialFilter) { 973 // 9.11. 2006 -> experiment with new spatial filter 974 #if 0 972 975 mViewCellsManager->ApplySpatialFilter(mKdTree, 973 976 mSpatialFilterSize* 974 977 Magnitude(mViewCellsManager->GetViewSpaceBox().Size()), 975 978 pvs); 979 #else 980 // mSpatialFilter size is in range 0.001 - 0.1 981 mViewCellsManager->ApplyFilter2(viewcell, 982 mUseFilter, 983 100*mSpatialFilterSize, 984 pvs); 985 #endif 976 986 } 977 987 -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
r1723 r1737 366 366 367 367 void 368 NormalizeRatios(float ratios[ 3])368 NormalizeRatios(float ratios[4]) 369 369 { 370 370 int i; 371 371 float sumRatios; 372 sumRatios = ratios[0] + ratios[1] + ratios[2] ;372 sumRatios = ratios[0] + ratios[1] + ratios[2] + ratios[3]; 373 373 if (sumRatios == 0.0f) { 374 374 ratios[0] = ratios[1] = ratios[2] = 1.0f; 375 sumRatios = 3.0f;376 } 377 378 for (i=0 ; i < 3; i++)375 sumRatios = 4.0f; 376 } 377 378 for (i=0 ; i < 4; i++) 379 379 ratios[i]/=sumRatios; 380 380 … … 387 387 #endif 388 388 389 for (; i < 3; i++)389 for (; i < 4; i++) 390 390 if (ratios[i] < MIN_RATIO) 391 391 ratios[i] = MIN_RATIO; 392 392 393 sumRatios = ratios[0] + ratios[1] + ratios[2] ;394 for (i=0 ; i < 3; i++)393 sumRatios = ratios[0] + ratios[1] + ratios[2] + ratios[3]; 394 for (i=0 ; i < 4; i++) 395 395 ratios[i]/=sumRatios; 396 396 … … 432 432 int rssPass = 0; 433 433 int rssSamples = 0; 434 435 mDistributions.push_back(SamplingDistribution(SamplingStrategy::RSS_BASED_DISTRIBUTION)); 436 mDistributions.push_back(SamplingDistribution(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION)); 437 mDistributions.push_back(SamplingDistribution(SamplingStrategy::DIRECTION_BASED_DISTRIBUTION)); 438 mDistributions.push_back(SamplingDistribution(SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION)); 434 439 435 440 if (mLoadInitialSamples) { … … 439 444 } else { 440 445 SimpleRayContainer rays; 441 446 442 447 cout<<"Generating initial rays..."<<endl<<flush; 443 448 444 449 if (mUseImportanceSampling) { 445 GenerateRays(mInitialSamples/ 2, SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION, rays);450 GenerateRays(mInitialSamples/3, SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION, rays); 446 451 // GenerateRays(mInitialSamples/3, SamplingStrategy::OBJECT_BASED_DISTRIBUTION, rays); 447 GenerateRays(mInitialSamples/2, SamplingStrategy::DIRECTION_BASED_DISTRIBUTION, rays); 452 GenerateRays(mInitialSamples/3, SamplingStrategy::DIRECTION_BASED_DISTRIBUTION, rays); 453 GenerateRays(mInitialSamples/3, SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION, rays); 448 454 // GenerateRays(mInitialSamples/4, OBJECT_DIRECTION_BASED_DISTRIBUTION, rays); 455 456 449 457 } else { 450 458 int rayType = SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION; 451 459 if (mObjectBasedSampling) 452 460 rayType = SamplingStrategy::OBJECT_BASED_DISTRIBUTION; … … 578 586 579 587 #if USE_RSS_TREE 580 static float ratios[] = {0.9f,0.05f,0.05f };588 static float ratios[] = {0.9f,0.05f,0.05f,0.05f}; 581 589 #else 582 static float ratios[] = {0.0f,0.05f,0.05f };590 static float ratios[] = {0.0f,0.05f,0.05f,0.05f}; 583 591 #endif 584 592 NormalizeRatios(ratios); 585 593 586 cout<<"New ratios: "<<ratios[0]<<" "<<ratios[1]<<" "<<ratios[2]<< endl;594 cout<<"New ratios: "<<ratios[0]<<" "<<ratios[1]<<" "<<ratios[2]<<" "<<ratios[3]<<endl; 587 595 588 596 //float ratios[] = {1.0f,0.0f,0.0f}; 589 597 590 int nrays[ 3];591 float contributions[ 3];592 float times[ 3];598 int nrays[4]; 599 float contributions[4]; 600 float times[4]; 593 601 594 602 long t1; … … 660 668 } 661 669 670 if (ratios[3]!=0.0f) { 671 t1 = GetTime(); 672 GenerateRays(int(mRssSamplesPerPass*ratios[3]), 673 SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION, rays); 674 CastRays(rays, tmpVssRays, true); 675 castRays += (int)rays.size(); 676 #if ADD_RAYS_IN_PLACE 677 contributions[3] = mViewCellsManager->ComputeSampleContributions(tmpVssRays, true, false); 678 #else 679 contributions[3] = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false, true); 680 #endif 681 times[3] = TimeDiff(t1, GetTime()); 682 nrays[3] = (int)rays.size(); 683 684 mStats<<"#DirectionalRelContrib"<<endl<<contributions[3]/nrays[3]<<endl; 685 686 vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() ); 687 688 rays.clear(); 689 tmpVssRays.clear(); 690 } 691 662 692 663 693 // now evaluate the ratios for the next pass … … 668 698 ratios[1] = sqr(contributions[1]/(TIME_WEIGHT*times[1] + (1 - TIME_WEIGHT)*nrays[1])); 669 699 ratios[2] = sqr(contributions[2]/(TIME_WEIGHT*times[2] + (1 - TIME_WEIGHT)*nrays[2])); 700 ratios[3] = sqr(contributions[3]/(TIME_WEIGHT*times[3] + (1 - TIME_WEIGHT)*nrays[3])); 670 701 #else 671 702 ratios[0] = contributions[0]/(TIME_WEIGHT*times[0] + (1 - TIME_WEIGHT)*nrays[0]); 672 703 ratios[1] = contributions[1]/(TIME_WEIGHT*times[1] + (1 - TIME_WEIGHT)*nrays[1]); 673 704 ratios[2] = contributions[2]/(TIME_WEIGHT*times[2] + (1 - TIME_WEIGHT)*nrays[2]); 705 ratios[3] = contributions[3]/(TIME_WEIGHT*times[3] + (1 - TIME_WEIGHT)*nrays[3]); 706 674 707 #endif 675 708 -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h
r1563 r1737 14 14 class RssTreeLeaf; 15 15 16 16 class SamplingDistribution { 17 public: 18 SamplingDistribution() {} 19 SamplingDistribution(const int t):mType(t) {} 20 int mType; 21 int mRays; 22 float mContribution; 23 float mTime; 24 }; 25 17 26 /** Sampling based visibility preprocessing. The implementation is 18 27 based on heuristical sampling of view space … … 21 30 22 31 public: 32 vector<SamplingDistribution> mDistributions; 23 33 int mSamplesPerPass; 24 34 int mRssSamplesPerPass; … … 40 50 //AxisAlignedBox3 *mViewSpaceBox; 41 51 52 42 53 ofstream mStats; 43 54 RssTree *mRssTree; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1736 r1737 261 261 262 262 263 void 264 ViewCellsManager::CollectObjects(const AxisAlignedBox3 &box, ObjectContainer &objects) 265 { 266 GetPreprocessor()->mKdTree->CollectObjects(box, objects); 267 } 263 268 264 269 AxisAlignedBox3 ViewCellsManager::GetViewCellBox(ViewCell *vc) … … 1731 1736 void ViewCellsManager::UpdatePvs() 1732 1737 { 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 { 1745 1738 if (mViewCellPvsIsUpdated || !ViewCellsTreeConstructed()) 1739 return; 1740 1741 mViewCellPvsIsUpdated = true; 1742 1743 ViewCellContainer leaves; 1744 mViewCellsTree->CollectLeaves(mViewCellsTree->GetRoot(), leaves); 1745 1746 ViewCellContainer::const_iterator it, it_end = leaves.end(); 1747 1748 for (it = leaves.begin(); it != it_end; ++ it) 1749 { 1750 mViewCellsTree->PropagatePvs(*it); 1746 1751 } 1747 1752 } … … 1750 1755 void ViewCellsManager::GetPvsStatistics(PvsStatistics &stat) 1751 1756 { 1752 // update pvs of view cells tree if necessary 1753 UpdatePvs(); 1754 1755 ViewCellContainer::const_iterator it = mViewCells.begin(); 1756 1757 stat.viewcells = 0; 1758 stat.minPvs = 100000000; 1759 stat.maxPvs = 0; 1760 stat.avgPvs = 0.0f; 1761 1762 for (; it != mViewCells.end(); ++ it) 1763 { 1764 ViewCell *viewcell = *it; 1765 1766 const float pvsCost = mViewCellsTree->GetPvsCost(viewcell); 1767 1768 if (pvsCost < stat.minPvs) 1769 stat.minPvs = pvsCost; 1770 if (pvsCost > stat.maxPvs) 1771 stat.maxPvs = pvsCost; 1772 1773 stat.avgPvs += pvsCost; 1774 1775 ++ stat.viewcells; 1776 } 1777 1778 if (stat.viewcells) 1779 stat.avgPvs/=stat.viewcells; 1757 // update pvs of view cells tree if necessary 1758 UpdatePvs(); 1759 1760 ViewCellContainer::const_iterator it = mViewCells.begin(); 1761 1762 stat.viewcells = 0; 1763 stat.minPvs = 100000000; 1764 stat.maxPvs = 0; 1765 stat.avgPvs = 0.0f; 1766 stat.avgFilteredPvs = 0.0f; 1767 stat.avgFilterContribution = 0.0f; 1768 1769 for (; it != mViewCells.end(); ++ it) 1770 { 1771 ViewCell *viewcell = *it; 1772 1773 const float pvsCost = mViewCellsTree->GetPvsCost(viewcell); 1774 1775 if (pvsCost < stat.minPvs) 1776 stat.minPvs = pvsCost; 1777 if (pvsCost > stat.maxPvs) 1778 stat.maxPvs = pvsCost; 1779 1780 stat.avgPvs += pvsCost; 1781 1782 if (0) { 1783 ObjectPvs filteredPvs = viewcell->GetPvs(); 1784 ApplyFilter2(viewcell, false, 1.0f, filteredPvs); 1785 float filteredCost = filteredPvs.EvalPvsCost(); 1786 stat.avgFilteredPvs += filteredCost; 1787 stat.avgFilterContribution += filteredCost - pvsCost; 1788 } 1789 1790 ++ stat.viewcells; 1791 } 1792 1793 if (stat.viewcells) { 1794 stat.avgPvs/=stat.viewcells; 1795 stat.avgFilteredPvs/=stat.viewcells; 1796 stat.avgFilterContribution/=stat.viewcells; 1797 } 1780 1798 } 1781 1799 … … 1787 1805 GetPvsStatistics(pvsStat); 1788 1806 s<<"#AVG_PVS\n"<<pvsStat.avgPvs<<endl; 1807 s<<"#AVG_FILTERED_PVS\n"<<pvsStat.avgFilteredPvs<<endl; 1808 s<<"#AVG_FILTER_CONTRIBUTION\n"<<pvsStat.avgFilterContribution<<endl; 1789 1809 s<<"#MAX_PVS\n"<<pvsStat.maxPvs<<endl; 1790 1810 s<<"#MIN_PVS\n"<<pvsStat.minPvs<<endl; … … 2497 2517 void 2498 2518 ViewCellsManager::ApplyFilter2(ViewCell *viewCell, 2499 KdTree *kdTree,2519 const bool useViewSpaceFilter, 2500 2520 const float filterSize, 2501 2521 ObjectPvs &pvs 2502 2522 ) 2503 2523 { 2504 Vector3 center = viewCell->GetBox().Center(); 2524 AxisAlignedBox3 vbox = GetViewCellBox(viewCell); 2525 Vector3 center = vbox.Center(); 2505 2526 // first determine the average size of the filter 2506 2507 2508 2527 2509 2528 Intersectable::NewMail(); … … 2518 2537 int pvsSize = 0; 2519 2538 int nPvsSize = 0; 2520 int samples = pvs.mSamples; 2521 2522 2539 float samples = pvs.mSamples; 2540 cout<<"Samples = "<<samples<<endl; 2541 // cout<<"Filter size = "<<filterSize<<endl; 2542 // cout<<"vbox = "<<vbox<<endl; 2543 // cout<<"center = "<<center<<endl; 2544 2545 2546 #define MIN_LOCAL_SAMPLES 5 2547 2548 // compute the average filter radius 2549 float globalC = 2.0f*filterSize/sqrt(samples); 2550 2551 float sumRadius = 0.0f; 2523 2552 for (oi = pvs.mEntries.begin(); oi != pvs.mEntries.end(); ++oi, pvsSize++) { 2524 2553 Intersectable *object = (*oi).first; 2525 2554 // compute filter size based on the distance and the numebr of samples 2526 float distance = Distance(center, object->GetBox().Center()); 2527 2555 AxisAlignedBox3 box = object->GetBox(); 2556 2557 float distance = Distance(center, box.Center()); 2558 float globalRadius = distance*globalC; 2559 2560 int objectSamples = (int)(*oi).second.mSumPdf; 2561 float localRadius = MAX_FLOAT; 2562 2563 if (objectSamples > MIN_LOCAL_SAMPLES) 2564 localRadius = 0.5f*Magnitude(box.Diagonal())/sqrt((float)objectSamples); 2565 2528 2566 // now compute the filter size 2529 float radius = distance*(filterSize/(4*samples)); 2567 float radius = Min(localRadius, globalRadius); 2568 2569 sumRadius +=radius; 2570 } 2571 2572 float avgRadius = sumRadius/pvsSize; 2573 float viewCellRadius = 0.5f*Magnitude(vbox.Diagonal()); 2574 cout<<"radius ratio = "<<avgRadius/viewCellRadius<<endl; 2575 2576 // now compute the filter box around the current viewCell 2577 2578 if (useViewSpaceFilter) { 2579 // float radius = Max(viewCellRadius/100.0f, avgRadius - viewCellRadius); 2580 float radius = viewCellRadius/100.0f; 2581 vbox.Enlarge(radius); 2582 cout<<"vbox = "<<vbox<<endl; 2583 ViewCellContainer viewCells; 2584 ComputeBoxIntersections(vbox, viewCells); 2585 2586 // cout<<"box="<<box<<endl; 2587 ViewCellContainer::const_iterator it = viewCells.begin(), it_end = viewCells.end(); 2588 2589 int i; 2590 for (i=0; it != it_end; ++ it, ++ i) 2591 if ((*it) != viewCell) { 2592 //cout<<"v"<<i<<" pvs="<<(*it)->GetPvs().mEntries.size()<<endl; 2593 pvs.Merge((*it)->GetPvs()); 2594 } 2595 2596 // update samples and globalC 2597 samples = pvs.mSamples; 2598 globalC = 2.0f*filterSize/sqrt(samples); 2599 cout<<"neighboring viewcells = "<<i-1<<endl; 2600 cout<<"Samples' = "<<samples<<endl; 2601 } 2602 2603 for (oi = pvs.mEntries.begin(); oi != pvs.mEntries.end(); ++oi) { 2604 Intersectable *object = (*oi).first; 2605 // compute filter size based on the distance and the numebr of samples 2530 2606 AxisAlignedBox3 box = object->GetBox(); 2607 2608 float distance = Distance(center, box.Center()); 2609 float globalRadius = distance*globalC; 2610 2611 2612 int objectSamples = (int)(*oi).second.mSumPdf; 2613 float localRadius = MAX_FLOAT; 2614 if (objectSamples > MIN_LOCAL_SAMPLES) 2615 localRadius = filterSize*0.5f*Magnitude(box.Diagonal())/sqrt((float)objectSamples); 2616 2617 // cout<<"lr="<<localRadius<<" gr="<<globalRadius<<endl; 2618 2619 // now compute the filter size 2620 float radius = Min(localRadius, globalRadius); 2621 2622 // cout<<"box = "<<box<<endl; 2623 // cout<<"distance = "<<distance<<endl; 2624 // cout<<"radiues = "<<radius<<endl; 2625 2531 2626 box.Enlarge(Vector3(radius)); 2532 2627 2533 2628 ObjectContainer objects; 2534 2629 // $$ warning collect objects takes only unmailed ones! 2535 // should use VspOsp!! 2536 kdTree->CollectObjects(box, objects); 2630 CollectObjects(box, objects); 2537 2631 // cout<<"collected objects="<<objects.size()<<endl; 2538 2632 ObjectContainer::const_iterator noi = objects.begin(); … … 2544 2638 } 2545 2639 } 2546 //cout<<"nPvs size = "<<nPvsSize<<endl;2640 cout<<"nPvs size = "<<nPvsSize<<endl; 2547 2641 pvs.Merge(nPvs); 2642 Intersectable::NewMail(); 2548 2643 } 2549 2644 … … 5724 5819 } 5725 5820 5821 void 5822 VspOspViewCellsManager::CollectObjects(const AxisAlignedBox3 &box, ObjectContainer &objects) 5823 { 5824 mHierarchyManager->CollectObjects(box, objects); 5825 } 5826 5726 5827 5727 5828 #if 1 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r1715 r1737 64 64 struct PvsStatistics 65 65 { 66 float minPvs; 67 float maxPvs; 68 float avgPvs; 69 int viewcells; 66 float minPvs; 67 float maxPvs; 68 float avgPvs; 69 float avgFilteredPvs; 70 float avgFilterContribution; 71 int viewcells; 70 72 }; 71 73 … … 136 138 virtual void Visualize(const ObjectContainer &objects, 137 139 const VssRayContainer &sampleRays) = 0; 140 141 /** collect objects intersecting a given spatial box */ 142 virtual void CollectObjects(const AxisAlignedBox3 &box, ObjectContainer &objects); 138 143 139 144 /** type of the view cell container. … … 464 469 void 465 470 ApplyFilter2(ViewCell *viewCell, 466 KdTree *kdTree,471 const bool useViewSpaceFilter, 467 472 const float filterSize, 468 473 ObjectPvs &pvs … … 1147 1152 ///////////////////////////////////////// 1148 1153 1154 /** collect objects intersecting a given spatial box */ 1155 virtual void CollectObjects(const AxisAlignedBox3 &box, ObjectContainer &objects); 1156 1149 1157 HierarchyManager *mHierarchyManager; 1150 1158 }; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1733 r1737 2769 2769 ViewCell::NewMail(); 2770 2770 2771 nodeStack.push(mRoot); 2772 2771 2773 while (!nodeStack.empty()) 2772 2774 { … … 2776 2778 const AxisAlignedBox3 bbox = GetBoundingBox(node); 2777 2779 2778 if (bbox.Includes(box)) 2779 { 2780 // node geometry is contained in box 2781 CollectViewCells(node, true, viewCells, true); 2782 } 2783 else if (Overlap(bbox, box)) 2784 { 2785 if (node->IsLeaf()) 2786 { 2787 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 2788 2789 if (!leaf->GetViewCell()->Mailed() && leaf->TreeValid()) 2780 if (Overlap(bbox, box)) { 2781 if (node->IsLeaf()) 2782 { 2783 VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 2784 2785 if (!leaf->GetViewCell()->Mailed() && leaf->TreeValid()) 2790 2786 { 2791 2792 2787 leaf->GetViewCell()->Mail(); 2788 viewCells.push_back(leaf->GetViewCell()); 2793 2789 } 2794 2790 } 2795 2796 { 2797 2798 2799 2800 2801 2802 2803 2804 } 2805 } 2791 else 2792 { 2793 VspInterior *interior = dynamic_cast<VspInterior *>(node); 2794 2795 VspNode *first = interior->GetFront(); 2796 VspNode *second = interior->GetBack(); 2797 2798 nodeStack.push(first); 2799 nodeStack.push(second); 2800 } 2801 } 2806 2802 // default: cull 2807 2803 } -
GTP/trunk/Lib/Vis/Preprocessing/src/default.env
r1715 r1737 19 19 #filename ../data/vienna/vienna.obj 20 20 21 filename ../data/vienna/vienna -buildings_vienna-roofs_vienna-roads_vienna-plane_cropped.obj21 filename ../data/vienna/vienna_cropped.obj 22 22 23 23 # filename ../data/vienna/viewcells-25-sel.x3d … … 51 51 # type render 52 52 detectEmptyViewSpace true 53 pvsRenderErrorSamples 054 # pvsRenderErrorSamples 500053 # pvsRenderErrorSamples 0 54 pvsRenderErrorSamples 1000 55 55 quitOnFinish true 56 56 computeVisibility true … … 84 84 vssSamples 50000000 85 85 # vssSamples 1000000 86 vssSamplesPerPass 200000086 vssSamplesPerPass 3000000 87 87 useImportanceSampling true 88 88 … … 196 196 #type vspKdTree 197 197 #type bspTree 198 type vspBspTree199 #type vspOspTree198 #type vspBspTree 199 type vspOspTree 200 200 #type sceneDependent 201 201 … … 289 289 # filename ../data/vienna/vsposp-seq-viewCells.xml.gz 290 290 291 filename ../data/vienna/vienna_cropped-2-sequential-30000-viewcells.xml.gz 291 filename ../data/vienna/vienna_cropped-gradient-2-viewcells.xml.gz 292 293 # filename ../data/vienna/vienna_cropped-2-sequential-30000-viewcells.xml.gz 292 294 # filename ../data/vienna/vienna_cropped-sequential-400000-viewcells.xml.gz 293 295
Note: See TracChangeset
for help on using the changeset viewer.