- Timestamp:
- 11/05/05 13:18:14 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r379 r380 557 557 if (exporter) 558 558 { 559 //exporter->ExportBspViewCellPartition(*mBspTree, stat.maxPvs);560 exporter->ExportBspViewCellPartition(*mBspTree, 0);559 exporter->ExportBspViewCellPartition(*mBspTree, stat.maxPvs); 560 //exporter->ExportBspViewCellPartition(*mBspTree, 0); 561 561 delete exporter; 562 562 } … … 592 592 if (exporter) 593 593 { 594 //exporter->ExportBspViewCellPartition(*mBspTree, stat.maxPvs);595 exporter->ExportBspViewCellPartition(*mBspTree, 0);594 exporter->ExportBspViewCellPartition(*mBspTree, stat.maxPvs); 595 //exporter->ExportBspViewCellPartition(*mBspTree, 0); 596 596 delete exporter; 597 597 } … … 686 686 } 687 687 688 boolSamplingPreprocessor::ProcessBspViewCells(Ray &ray,688 void SamplingPreprocessor::ProcessBspViewCells(Ray &ray, 689 689 Intersectable *object, 690 690 int faceIndex, … … 693 693 { 694 694 // save rays for bsp tree construction 695 if ((BspTree::sConstructionMethod == BspTree::FROM_RAYS) && 696 (mSampleRays.size() < mBspConstructionSamples)) 695 if (!mBspTree) 697 696 { 698 // also add origin to sample in order to extract it as input polygons 699 MeshInstance *mi = dynamic_cast<MeshInstance *>(object); 700 ray.sourceObject = Ray::Intersection(0.0, mi, faceIndex); 697 if ((BspTree::sConstructionMethod == BspTree::FROM_RAYS) && 698 ((int)mSampleRays.size() < mBspConstructionSamples)) 699 { 700 // also add origin to sample in order to extract it as input polygons 701 MeshInstance *mi = dynamic_cast<MeshInstance *>(object); 702 ray.sourceObject = Ray::Intersection(0.0, mi, faceIndex); 701 703 702 mSampleRays.push_back(new Ray(ray)); 703 704 return false; 705 } 706 707 if (!mBspTree) // construct BSP tree using the samples 704 mSampleRays.push_back(new Ray(ray)); 705 Debug << "abba " << mSampleRays.size() << endl; 706 } 707 else 708 { 709 // construct BSP tree using the samples 710 cout << "building bsp tree from " << mSampleRays.size() << " samples " << endl; 711 BuildBspTree(); 712 713 // add contributions of saved samples to PVS 714 contributingSamples += mBspTree->GetStat().contributingSamples; 715 sampleContributions += mBspTree->GetStat().sampleContributions; 716 717 BspTreeStatistics(Debug); 718 719 if (0) Export("vc_bsptree.x3d", false, false, true); 720 721 // throw away samples because BSP leaves not stored in order 722 // Need ordered rays for post processing => collect new rays 723 CLEAR_CONTAINER(mSampleRays); 724 } 725 } 726 // save rays for post processing 727 else if ((int)mSampleRays.size() < mPostProcessSamples) 708 728 { 709 cout << "building bsp tree from " << mSampleRays.size() << " samples " << endl; 710 BuildBspTree(); 711 712 // add contributions of saved samples to PVS 713 contributingSamples += mBspTree->GetStat().contributingSamples; 714 sampleContributions += mBspTree->GetStat().sampleContributions; 715 716 BspTreeStatistics(Debug); 717 718 if (0) Export("vc_bsptree.x3d", false, false, true); 719 720 // throw away samples because BSP leaves not stored in order 721 // Need ordered rays for post processing => collect new rays 722 CLEAR_CONTAINER(mSampleRays); 723 } 724 725 if ((int)mSampleRays.size() < mPostProcessSamples) 726 { 729 Debug << "police " << mSampleRays.size() << endl; 727 730 mSampleRays.push_back(new Ray(ray)); 728 731 } 729 730 return true;731 732 } 732 733
Note: See TracChangeset
for help on using the changeset viewer.