- Timestamp:
- 11/03/05 18:49:59 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r374 r375 514 514 << "k #SampleContributions=" << passSampleContributions << " (" 515 515 << 100*passContributingSamples/(float)passSamples<<"%)" << " avgPVS=" 516 << pvsSize /(float)objects.size() << endl516 << pvsSize /(float)objects.size() << endl 517 517 << "avg ray contrib=" << avgRayContrib << endl 518 518 << "reverse samples [%]" << reverseSamples/(float)passSamples*100.0f << endl; … … 531 531 cout << "#totalPvsSize=" << mKdTree->CollectLeafPvs() << endl; 532 532 533 //-- post processing of bsp view cells 533 534 if (mBspTree) 534 535 { 536 int vcSize = 0; 537 int pvsSize = 0; 538 539 BspViewCellsStatistics stat; 540 541 Debug << "overall scene size: " << objects.size() << endl; 542 mBspTree->EvaluateViewCellsStats(stat); 543 544 Debug << "original view cell partition:\n" << stat << endl; 545 535 546 cout << "starting post processing using " << mSampleRays.size() << " samples ... "; 536 537 Debug << "original pvs size: " << mBspTree->CountViewCellPvs() << endl; 538 539 // merge or subdivide view cells 547 540 548 long startTime = GetTime(); 541 549 int merged = PostprocessViewCells(mSampleRays); … … 545 553 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl; 546 554 555 cout << "evaluating render time heuristics ... "; 556 547 557 //-- recount pvs 548 Debug << "merged pvs size: " << mBspTree->CountViewCellPvs() << endl;549 550 551 cout << "evaluating render time heuristics ... "; 558 mBspTree->EvaluateViewCellsStats(stat); 559 560 Debug << "after post processing:\n" << stat << endl; 561 552 562 Real rt = SimulateRendering(); 553 563 cout << "finished" << endl; … … 591 601 592 602 // export the bsp splits 603 cout << "exporting splits ... "; 593 604 if (exportSplits) 594 605 ExportSplits(objects); 595 606 cout << "finished" << endl; 607 596 608 ExportBspPvs(objects); 597 609 } … … 686 698 { 687 699 int merged = 0; 700 688 701 RayContainer::const_iterator rit, rit_end = rays.end(); 689 702 vector<Ray::BspIntersection>::const_iterator iit; … … 708 721 { 709 722 mBspTree->MergeViewCells(leaf, previousLeaf); 723 710 724 ++ merged; 711 725 } … … 723 737 if (exporter) 724 738 { 725 cout << "exporting splits ... ";726 727 739 Material m; 728 740 m.mDiffuseColor = RgbColor(1, 0, 0); … … 769 781 770 782 delete exporter; 771 772 cout << "finished" << endl;773 783 } 774 784 } … … 787 797 const int raysOut = min((int)mSampleRays.size(), 20000); 788 798 789 // check whether we can add the current ray to the output rays 790 for (int k = 0; k < raysOut; ++ k) 799 ViewCell::NewMail(); 800 801 for (int i = 0; i < bspLeaves.size(); ++ i) 791 802 { 792 Ray *ray = mSampleRays[k];793 794 for (int j = 0; j < (int)ray->bspIntersections.size(); ++ j)795 { 796 BspLeaf *leaf = ray->bspIntersections[j].mLeaf;797 798 for (int i = 0; i < (int)bspLeaves.size(); ++ i)803 cout << "creating output for view cell " << i << " ... "; 804 // check whether we can add the current ray to the output rays 805 for (int k = 0; k < raysOut; ++ k) 806 { 807 Ray *ray = mSampleRays[k]; 808 809 for (int j = 0; j < (int)ray->bspIntersections.size(); ++ j) 799 810 { 811 BspLeaf *leaf = ray->bspIntersections[j].mLeaf; 812 800 813 if (bspLeaves[i]->GetViewCell() == leaf->GetViewCell()) 801 814 { … … 804 817 } 805 818 } 806 } 807 808 ViewCell::NewMail(); 809 810 for (int i = 0; i < bspLeaves.size(); ++ i) 811 { 819 812 820 Intersectable::NewMail(); 813 821 … … 883 891 } 884 892 DEL_PTR(exporter); 893 cout << "finished" << endl; 885 894 } 886 895 887 896 if (1) // export view cells and leaves 888 897 { 898 cout << "exporting view cells and leaves ... "; 889 899 Exporter *exporter = Exporter::GetExporter("viewCells.x3d"); 890 900 if (exporter) … … 901 911 delete exporter; 902 912 } 913 cout << "finished" << endl; 903 914 } 904 915
Note: See TracChangeset
for help on using the changeset viewer.