- Timestamp:
- 02/16/06 18:29:36 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/default.env
r648 r649 177 177 Construction { 178 178 samples 0 179 samplesPerPass 50000 0179 samplesPerPass 50000 180 180 } 181 181 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r648 r649 50 50 return (float)pvs; 51 51 } 52 53 54 52 55 53 … … 1413 1411 1414 1412 1413 void ViewCellsTree::ExportStats() 1414 { 1415 1416 } 1415 1417 1416 1418 void ViewCellsTree::GetPvs(ViewCell *vc, ObjectPvs &pvs) const -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r613 r649 108 108 int Type() const; 109 109 110 110 void SetParent(ViewCellInterior *parent); 111 111 112 112 /** Adds a passing ray to the passing ray container. … … 357 357 bool Export(ofstream &stream); 358 358 359 /** Export statistics of this view cell tree. 360 */ 361 void ExportStats(); 359 362 360 363 protected: -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
r648 r649 1182 1182 backData.mNode = interior->GetBack(); 1183 1183 1184 interior->mTimeStamp = leaf->mTimeStamp; 1184 1185 frontData.mNode->mTimeStamp = mTimeStamp; 1185 1186 backData.mNode->mTimeStamp = mTimeStamp ++; 1186 1187 1188 Debug << "time stamp: " << mTimeStamp << endl; 1187 1189 //DEL_PTR(leaf); 1188 1190 return interior; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r643 r649 1032 1032 1033 1033 // recast rest of the rays 1034 ComputeSampleContributions(savedRays, true, false); 1034 if (SAMPLE_AFTER_SUBDIVISION) 1035 ComputeSampleContributions(savedRays, true, false); 1035 1036 1036 1037 … … 1143 1144 int merged; 1144 1145 1146 cout << "starting post processing using " << mPostProcessSamples << " samples ... "; 1147 long startTime = GetTime(); 1148 1149 VssRayContainer postProcessRays; 1150 GetRaySets(rays, mPostProcessSamples, postProcessRays); 1151 1145 1152 if (mMergeViewCells) 1146 1153 { 1147 cout << "starting post processing using " << mPostProcessSamples << " samples ... "; 1148 long startTime = GetTime(); 1149 1150 VssRayContainer postProcessRays; 1151 GetRaySets(rays, mPostProcessSamples, postProcessRays); 1152 1154 Debug << "constructing visibility based merge tree" << endl; 1153 1155 merged = mViewCellsTree->ConstructMergeTree(rays, objects); 1154 1155 //-- stats and visualizations 1156 cout << "finished" << endl; 1157 cout << "merged " << merged << " view cells in " 1158 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl; 1159 1160 Debug << "Postprocessing: Merged " << merged << " view cells in " 1161 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" 1162 << "using " << (int)rays.size() << " samples" << endl << endl; 1163 } 1156 } 1157 else 1158 { 1159 Debug << "constructing spatial merge tree" << endl; 1160 // create spatial merge hierarchy 1161 merged = ConstructSpatialMergeTree(); 1162 } 1163 1164 //-- stats and visualizations 1165 cout << "finished" << endl; 1166 cout << "merged " << merged << " view cells in " 1167 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl; 1168 1169 Debug << "Postprocessing: Merged " << merged << " view cells in " 1170 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl << endl; 1171 1164 1172 1165 1173 // reset view cells and stats … … 1674 1682 1675 1683 1676 void BspViewCellsManager::CreateMergeHierarchy()1684 int BspViewCellsManager::ConstructSpatialMergeTree() 1677 1685 { 1678 1686 TraversalQueue tQueue; 1679 1687 1680 1688 tQueue.push(TraversalData(mBspTree->GetRoot(), NULL)); 1689 1690 int merged = 0; 1691 1692 int numViewCells = (int)mViewCells.size(); 1693 1694 float var = 0; 1695 float dev = 0; 1696 int totalPvs = 0; 1697 float totalRenderCost = 0; 1698 float avgRenderCost = 0; 1699 float expCost = 0; 1700 1701 //-- compute statistics values of initial view cells 1702 EvaluateRenderStatistics(totalRenderCost, 1703 expCost, 1704 dev, 1705 var, 1706 totalPvs, 1707 avgRenderCost); 1708 1709 Debug/*mStats*/ << "#Pass\n" << 0 << endl 1710 << "#Merged\n" << merged << endl 1711 << "#ViewCells\n" << numViewCells << endl 1712 << "#RenderCostIncrease\n" << 0 << endl 1713 << "#TotalRenderCost\n" << totalRenderCost << endl 1714 << "#CurrentPvs\n" << 0 << endl 1715 << "#ExpectedCost\n" << expCost << endl 1716 << "#AvgRenderCost\n" << avgRenderCost << endl 1717 << "#Deviation\n" << dev << endl 1718 << "#TotalPvs\n" << totalPvs << endl 1719 << "#PvsSizeDecrease\n0" << endl 1720 << "#Volume\n0" << endl 1721 //<< "#Siblings\n" << mergeStats.siblings << endl 1722 << endl; 1723 1681 1724 1682 1725 while (!tQueue.empty()) … … 1689 1732 ViewCell *viewCell = dynamic_cast<BspLeaf *>(tData.mNode)->GetViewCell(); 1690 1733 viewCell->SetMergeCost((float)tData.mNode->mTimeStamp); 1734 1735 Debug << "leaf time stamp: " << tData.mNode->mTimeStamp << endl; 1691 1736 1692 1737 if (tData.mParentViewCell) 1693 1738 { 1694 1739 tData.mParentViewCell->SetupChildLink(viewCell); 1695 // pro bagate up pvs1740 // propagate up pvs: could be redone as propagepvs, which propagates pvs up and down 1696 1741 mViewCellsTree->PropagateUpPvs(viewCell); 1697 1742 } … … 1701 1746 BspInterior *interior = dynamic_cast<BspInterior *>(tData.mNode); 1702 1747 ViewCellInterior *viewCellInterior = new ViewCellInterior(); 1748 1749 ++ merged; 1750 -- numViewCells; 1751 1752 avgRenderCost = totalPvs / numViewCells; 1753 1754 Debug//mStats 1755 << "#Pass\n" << 0 << endl 1756 << "#Merged\n" << merged << endl 1757 << "#ViewCells\n" << numViewCells << endl 1758 << "#RenderCostIncrease\n" << 0 << endl 1759 << "#TotalRenderCost\n" << totalRenderCost << endl 1760 << "#CurrentPvs\n" << 0 << endl 1761 << "#ExpectedCost\n" << 0 << endl 1762 << "#AvgRenderCost\n" << avgRenderCost << endl 1763 << "#Deviation\n" << dev << endl 1764 << "#TotalPvs\n" << totalPvs << endl 1765 << "#PvsSizeDecrease\n" << 0 << endl 1766 << "#Volume\n" << 0 << endl 1767 << endl; 1768 1769 Debug << "interior time stamp: " << tData.mNode->mTimeStamp << endl; 1770 1703 1771 viewCellInterior->SetMergeCost((float)tData.mNode->mTimeStamp); 1704 1772 … … 1711 1779 } 1712 1780 } 1781 1782 return merged; 1713 1783 } 1714 1784 … … 2838 2908 2839 2909 2840 void VspBspViewCellsManager::CreateMergeHierarchy()2910 int VspBspViewCellsManager::ConstructSpatialMergeTree() 2841 2911 { 2842 2912 TraversalQueue tQueue; 2843 2844 2913 tQueue.push(TraversalData(mVspBspTree->GetRoot(), NULL)); 2914 2915 int merged = 0; 2845 2916 2846 2917 while (!tQueue.empty()) … … 2864 2935 BspInterior *interior = dynamic_cast<BspInterior *>(tData.mNode); 2865 2936 ViewCellInterior *viewCellInterior = new ViewCellInterior(); 2866 2937 ++ merged; 2938 2867 2939 tQueue.push(TraversalData(interior->GetBack(), viewCellInterior)); 2868 2940 tQueue.push(TraversalData(interior->GetFront(), viewCellInterior)); … … 2872 2944 } 2873 2945 } 2946 return merged; 2874 2947 } 2875 2948 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r610 r649 353 353 354 354 355 virtual void CreateMergeHierarchy() {};355 virtual int ConstructSpatialMergeTree() { return 0;}; 356 356 357 357 virtual bool EqualToSpatialNode(ViewCell *viewCell) const { return false;} … … 529 529 bool ExportViewCells(const string filename); 530 530 531 void CreateMergeHierarchy();531 int ConstructSpatialMergeTree(); 532 532 533 533 … … 815 815 void PrepareLoadedViewCells(); 816 816 817 void CreateMergeHierarchy(); 817 int ConstructSpatialMergeTree(); 818 818 819 /// the view space partition BSP tree. 819 820 VspBspTree *mVspBspTree;
Note: See TracChangeset
for help on using the changeset viewer.