- Timestamp:
- 01/25/06 01:44:46 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.cpp
r564 r574 27 27 environment->GetIntValue("VssPreprocessor.vssSamplesPerPass", mVssSamplesPerPass); 28 28 environment->GetBoolValue("VssPreprocessor.useImportanceSampling", mUseImportanceSampling); 29 environment->GetBoolValue("ViewCells.delayedConstruction", mDelayedViewCellsConstruction); 30 29 31 30 environment->GetBoolValue("VssPreprocessor.loadInitialSamples", mLoadInitialSamples); 32 31 environment->GetBoolValue("VssPreprocessor.storeInitialSamples", mStoreInitialSamples); … … 54 53 ray.Init(point, direction, Ray::LOCAL_RAY); 55 54 } 55 56 57 void 58 VssPreprocessor::CastRays( 59 SimpleRayContainer &rays, 60 VssRayContainer &vssRays 61 ) 62 { 63 for (int i=0; i < rays.size(); i++) 64 CastRay(rays[i].mOrigin, rays[i].mDirection, vssRays); 65 } 66 56 67 57 68 int … … 529 540 mViewCellsManager->LoadViewCells(mViewCellsFilename, &mObjects); 530 541 } 531 542 else 543 { 544 // construct view cells using it's own set of samples 545 mViewCellsManager->Construct(this); 546 547 //-- several visualizations and statistics 548 Debug << "view cells after construction: " << endl; 549 mViewCellsManager->PrintStatistics(Debug); 550 } 551 532 552 533 553 VssTree *vssTree = NULL; … … 634 654 } 635 655 636 /// compute view cell contribution of rays if view cells manager already constructed637 mViewCellsManager->ComputeSampleContributions(mVssRays);638 639 // construct view cells640 if (!mDelayedViewCellsConstruction)641 mViewCellsManager->Construct(mObjects, mVssRays);642 643 656 vssTree = new VssTree; 644 657 // viewcells = Construct(mVssRays); … … 712 725 cout<<"Average PVS size = "<<avgPvs<<endl; 713 726 714 // construct view cells after vss715 if (!mViewCellsManager->ViewCellsConstructed() &&716 (samples + mInitialSamples >= mViewCellsManager->GetConstructionSamples()))717 {718 Debug << "samples " << samples << " initial " << mInitialSamples << " " << samples + mInitialSamples << endl;719 VssRayContainer constructionRays;720 vssTree->CollectRays(constructionRays, mViewCellsManager->GetConstructionSamples());721 722 Debug << "collected rays: " << constructionRays.size() << endl;723 724 // test if we really have enough rays725 //if (constructionRays.size() >= nSamples)726 mViewCellsManager->Construct(mObjects, constructionRays);727 }728 729 727 /// compute view cell contribution of rays 730 mViewCellsManager->ComputeSampleContributions(vssRays );728 mViewCellsManager->ComputeSampleContributions(vssRays, true, false); 731 729 732 730 if (numExportRays) { … … 750 748 } 751 749 752 753 // at the latest create view cells here754 if (!mViewCellsManager->ViewCellsConstructed())755 {756 VssRayContainer constructionRays;757 758 vssTree->CollectRays(constructionRays,759 mViewCellsManager->GetConstructionSamples());760 Debug << "collected rays: " << constructionRays.size() << endl;761 762 mViewCellsManager->Construct(mObjects, constructionRays);763 }764 765 Debug << vssTree->stat << endl;766 VssRayContainer viewCellRays;767 768 // compute rays used for view cells construction769 int numRays = Max(mViewCellsManager->GetPostProcessSamples(),770 mViewCellsManager->GetVisualizationSamples());771 772 vssTree->CollectRays(viewCellRays, numRays);773 774 //-- post process view cells775 mViewCellsManager->PostProcess(mObjects, viewCellRays);776 777 750 if (mTestBeamSampling && mUseGlRenderer) 778 751 { … … 780 753 } 781 754 782 //-- several visualizations and statistics 783 Debug << "\nview cells after post processing: " << endl; 784 mViewCellsManager->PrintStatistics(Debug); 785 786 mViewCellsManager->Visualize(mObjects, viewCellRays); 787 755 Debug << vssTree->stat << endl; 756 757 if (0) 758 { 759 VssRayContainer viewCellRays; 760 761 // compute rays used for view cells construction 762 const int numRays = mViewCellsManager->GetVisualizationSamples(); 763 764 vssTree->CollectRays(viewCellRays, numRays); 765 } 766 788 767 //-- render simulation after merge 789 cout << "\nevaluating bsp view cells render time after merge... ";768 cout << "\nevaluating bsp view cells render time after sampling ... "; 790 769 mRenderSimulator->RenderScene(); 791 770 SimulationStatistics ss;
Note: See TracChangeset
for help on using the changeset viewer.