Changeset 711
- Timestamp:
- 03/20/06 16:55:40 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/egsr_test_script
r675 r711 2 2 PROGRAM=../bin/release/Preprocessor.exe 3 3 4 SCENE=soda5 5 #SCENE=soda 4 #SCENE=$1 5 SCENE=soda 6 #SCENE=soda5 6 7 #SCENE=atlanta 7 8 #SCENE=vienna -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
r710 r711 467 467 } 468 468 469 469 470 BspViewCell *BspTree::GetOrCreateOutOfBoundsCell() 470 471 { … … 1706 1707 1707 1708 // construct child geometry with regard to the candidate split plane 1708 BspNodeGeometry frontCell; 1709 BspNodeGeometry backCell; 1710 1711 cell.SplitGeometry(frontCell, 1712 backCell, 1713 candidatePlane, 1714 mBox, 1715 mEpsilon); 1709 BspNodeGeometry geomFront; 1710 BspNodeGeometry geomBack; 1711 1712 const bool splitSuccessFull = 1713 cell.SplitGeometry(geomFront, 1714 geomBack, 1715 candidatePlane, 1716 mBox, 1717 mEpsilon); 1716 1718 1717 1719 if (mUseAreaForPvs) 1718 1720 { 1719 pFront = frontCell.GetArea();1720 pBack = backCell.GetArea();1721 pFront = geomFront.GetArea(); 1722 pBack = geomBack.GetArea(); 1721 1723 } 1722 1724 else 1723 1725 { 1724 pFront = frontCell.GetVolume();1726 pFront = geomFront.GetVolume(); 1725 1727 pBack = pOverall - pFront; 1726 1728 } 1727 1729 1730 1731 // give penalty to unbalanced split 1732 if (1 && 1733 (!splitSuccessFull || (pFront <= 0) || (pBack <= 0) || 1734 !geomFront.Valid() || !geomBack.Valid())) 1735 { 1736 Debug << "error f: " << pFront << " b: " << pBack << endl; 1737 return 99999.9f; 1738 } 1728 1739 1729 1740 pOverall = probability; … … 1793 1804 val += mBalancedRaysFactor * fabs(sumBalancedRays) / raysSize; 1794 1805 1795 const float denom = pOverall * (float)pvs * 2.0f+ Limits::Small;1806 const float denom = pOverall * (float)pvs + Limits::Small; 1796 1807 1797 1808 if (mSplitPlaneStrategy & PVS) 1798 1809 { 1799 1810 val += mPvsFactor * (frontPvs * pFront + (backPvs * pBack)) / denom; 1800 1801 // give penalty to unbalanced split1802 if (0)1803 if (((pFront * 0.2 + Limits::Small) > pBack) ||1804 (pFront < (pBack * 0.2 + Limits::Small)))1805 val += 0.5;1806 1811 } 1807 1812 … … 1975 1980 } 1976 1981 1977 int 1978 BspTree::_CastRay(Ray &ray)1982 1983 int BspTree::_CastRay(Ray &ray) 1979 1984 { 1980 1985 int hits = 0; … … 3085 3090 const float epsilon) const 3086 3091 { 3087 #if 0 3088 // trivial cases 3089 const int cf = Side(splitPlane, epsilon); 3090 3091 if (cf == -1) 3092 { 3093 back = *this; 3094 return false; 3095 } 3096 else if (cf == 1) 3097 { 3098 front = *this; 3099 return false; 3100 } 3101 #endif 3092 //-- trivial cases 3093 if (0) 3094 { 3095 const int cf = Side(splitPlane, epsilon); 3096 3097 if (cf == -1) 3098 { 3099 back = *this; 3100 return false; 3101 } 3102 else if (cf == 1) 3103 { 3104 front = *this; 3105 return false; 3106 } 3107 } 3102 3108 3103 3109 // get cross section of new polygon -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r710 r711 16 16 #include "RssPreprocessor.h" 17 17 18 #define SAMPLE_AFTER_SUBDIVISION 018 #define SAMPLE_AFTER_SUBDIVISION 1 19 19 #define TEST_EMPTY_VIEW_CELLS 0 20 20 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r710 r711 1055 1055 // subdivide further 1056 1056 1057 // store maximal and minimal depth 1058 if (tData.mDepth > mBspStats.maxDepth) 1059 { 1060 Debug << "max depth increases to " << tData.mDepth << " at " << mBspStats.Leaves() << " leaves" << endl; 1061 mBspStats.maxDepth = tData.mDepth; 1062 } 1063 1057 1064 mBspStats.nodes += 2; 1058 1065 1059 1066 1060 1067 BspInterior *interior = new BspInterior(splitPlane); 1061 1068 … … 1064 1071 #endif 1065 1072 1073 1066 1074 //-- create front and back leaf 1067 1075 … … 1087 1095 interior->mTimeStamp = mTimeStamp ++; 1088 1096 1097 1089 1098 //DEL_PTR(leaf); 1090 1099 return interior; … … 1142 1151 // creates a sorted split candidates array 1143 1152 if (mSplitCandidates->capacity() > 500000 && 1144 requestedSize < (int)(mSplitCandidates->capacity() 1153 requestedSize < (int)(mSplitCandidates->capacity() / 10) ) 1145 1154 { 1146 1155 delete mSplitCandidates; … … 1851 1860 pBack = pOverall - pFront; 1852 1861 1853 // clamp because of possible precision issues1862 // precision issues possible for unbalanced split => don't take this split! 1854 1863 if (1 && 1855 1864 (!splitSuccessFull || (pFront <= 0) || (pBack <= 0) || … … 1857 1866 { 1858 1867 Debug << "error f: " << pFront << " b: " << pBack << endl; 1859 return 999 ;1868 return 99999.9f; 1860 1869 } 1861 1870 } … … 2167 2176 BspLeaf *leaf = dynamic_cast<BspLeaf *>(data.mNode); 2168 2177 2169 // store maximal and minimal depth2170 if (data.mDepth > mBspStats.maxDepth)2171 mBspStats.maxDepth = data.mDepth;2172 2178 2173 2179 if (data.mPvs > mBspStats.maxPvs) 2180 { 2174 2181 mBspStats.maxPvs = data.mPvs; 2175 2182 } 2183 2176 2184 mBspStats.pvs += data.mPvs; 2177 2185 2178 2186 if (data.mDepth < mBspStats.minDepth) 2187 { 2179 2188 mBspStats.minDepth = data.mDepth; 2189 } 2180 2190 2181 2191 if (data.mDepth >= mTermMaxDepth) 2192 { 2182 2193 ++ mBspStats.maxDepthNodes; 2194 } 2183 2195 2184 2196 // accumulate rays to compute rays / leaf
Note: See TracChangeset
for help on using the changeset viewer.