Changeset 371 for trunk/VUT/GtpVisibilityPreprocessor
- Timestamp:
- 11/02/05 23:59:16 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r370 r371 82 82 # input fromViewCells 83 83 # input fromSceneGeometry 84 samples 20000084 samples 100000 85 85 sideTolerance 0.005 86 86 } -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r370 r371 531 531 cout << "#totalPvsSize=" << mKdTree->CollectLeafPvs() << endl; 532 532 533 // merge or subdivide view cells534 533 if (mBspTree) 535 534 { … … 538 537 Debug << "original pvs size: " << mBspTree->CountViewCellPvs() << endl; 539 538 539 // merge or subdivide view cells 540 540 long startTime = GetTime(); 541 541 int merged = PostprocessViewCells(mSampleRays); … … 548 548 Debug << "merged pvs size: " << mBspTree->CountViewCellPvs() << endl; 549 549 550 551 cout << "evaluating render time heuristics ... "; 552 Real rt = EvaluateRenderHeuristics(); 553 cout << "finished" << endl; 554 555 Debug << "render time: " << rt * 1e-3 << endl; 550 556 } 551 557 … … 881 887 } 882 888 } 889 890 Real SamplingPreprocessor::EvaluateRenderHeuristics() 891 { 892 Real renderTime = 0; 893 894 const float objRt = 1.0f; // render time for 1 object of PVS 895 const float vcOverhead = 1.0f; // const overhead for crossing a view cell border 896 897 float totalArea = 0; 898 899 ViewCellContainer viewCells; 900 901 mBspTree->CollectViewCells(viewCells); 902 903 ViewCellContainer::const_iterator it, it_end = viewCells.end(); 904 PolygonContainer::const_iterator pit; 905 906 for (it = viewCells.begin(); it != it_end; ++ it) 907 { 908 // surface area substitute for probability 909 PolygonContainer cell; 910 float area = 0; 911 912 mBspTree->ConstructGeometry(dynamic_cast<BspViewCell *>(*it), cell); 913 914 for (pit = cell.begin(); pit != cell.end(); ++ pit) 915 area += (*pit)->GetArea(); 916 917 renderTime += area * (*it)->GetPvs().GetSize() * objRt; 918 totalArea += area; 919 } 920 921 renderTime /= totalArea; 922 923 renderTime += (float)viewCells.size() * vcOverhead; 924 925 return renderTime; 926 } -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.h
r369 r371 97 97 int PostprocessViewCells(const RayContainer &rays); 98 98 99 /** Simulated rendering using a simple render heuristics. Used to evaluate the 100 quality of the view cell partition. 101 */ 102 Real EvaluateRenderHeuristics(); 99 103 }; 100 104
Note: See TracChangeset
for help on using the changeset viewer.