- Timestamp:
- 11/18/05 16:29:31 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r421 r422 73 73 mBspTree->Construct(objects); 74 74 break; 75 case BspTree::FROM_ RAYS:75 case BspTree::FROM_SAMPLES: 76 76 DeleteViewCells(); // we generate new view cells 77 77 mBspTree->SetGenerateViewCells(true); … … 490 490 passSampleContributions); 491 491 492 //mVspKdTree->Construct(mSampleRays, mBoundingBox);493 492 } 494 493 else if (ViewCell::sHierarchy == ViewCell::VSP) … … 555 554 556 555 //-- render simulation 557 cout << "\nevaluating bsp view cells render time before merge ... "; 558 GetRenderSimulator()->SimulateRendering(); 559 560 cout << " finished" << endl; 561 562 cout << GetRenderSimulator()->mStat << endl; 563 Debug << GetRenderSimulator()->mStat << endl; 564 556 RenderSimulator *rs = GetRenderSimulator(); 557 558 if (rs) 559 { 560 cout << "\nevaluating bsp view cells render time before merge ... "; 561 562 rs->SimulateRendering(); 563 564 cout << " finished" << endl; 565 566 cout << GetRenderSimulator()->mStat << endl; 567 Debug << GetRenderSimulator()->mStat << endl; 568 } 565 569 566 570 if (mBspTree) … … 618 622 619 623 //-- render simulation 620 cout << "\nevaluating render time after merge ... "; 621 622 GetRenderSimulator()->SimulateRendering(); 623 cout << " finished" << endl; 624 625 cout << GetRenderSimulator()->mStat << endl; 626 Debug << GetRenderSimulator()->mStat << endl; 624 625 RenderSimulator *rs = GetRenderSimulator(); 626 627 if (rs) 628 { 629 cout << "\nevaluating render time after merge ... "; 630 631 rs->SimulateRendering(); 632 633 cout << " finished" << endl; 634 635 cout << GetRenderSimulator()->mStat << endl; 636 Debug << GetRenderSimulator()->mStat << endl; 637 } 627 638 628 639 if (1) // export view cells … … 659 670 exporter->SetExportRayDensity(true); 660 671 exporter->ExportKdTree(*mKdTree); 661 662 if (mBspTree && (ViewCell::sHierarchy == ViewCell::VSP)) 663 exporter->ExportVspKdTree(*mVspKdTree); 664 672 delete exporter; 673 } 674 675 if (mVspKdTree) 676 { 677 Exporter *exporter = Exporter::GetExporter("vspkdtree.x3d"); 678 exporter->SetWireframe(); 679 exporter->ExportVspKdTree(*mVspKdTree); 665 680 delete exporter; 666 681 } … … 732 747 int &sampleContributions) 733 748 { 734 // save rays for bsp tree construction735 749 if (!mVspKdTree) 736 750 { 751 // store samples for vsp kd tree construction 737 752 if ((int)mVspSampleRays.size() < mVspConstructionSamples) 738 753 { 739 MeshInstance *mi = dynamic_cast<MeshInstance *>(object);740 741 754 VssRay *sRay = new VssRay(ray); 742 mVspSampleRays.push_back(sRay); 755 756 mVspSampleRays.push_back(sRay); 743 757 744 758 // also add origin to sample … … 749 763 // construct VSP tree using the collected samples 750 764 cout << "building VSP tree from " << (int)mVspSampleRays.size() << " samples " << endl; 765 mVspKdTree = new VspKdTree(); 751 766 mVspKdTree->Construct(mVspSampleRays); 752 767 … … 779 794 if (!mBspTree) 780 795 { 781 if ((BspTree::sConstructionMethod == BspTree::FROM_ RAYS) &&796 if ((BspTree::sConstructionMethod == BspTree::FROM_SAMPLES) && 782 797 ((int)mSampleRays.size() < mBspConstructionSamples)) 783 798 { … … 889 904 outRays.push_back(mSampleRays[i]); 890 905 } 891 if (BspTree::sConstructionMethod == BspTree::FROM_ RAYS)906 if (BspTree::sConstructionMethod == BspTree::FROM_SAMPLES) 892 907 { 893 908 // export rays
Note: See TracChangeset
for help on using the changeset viewer.