Changeset 2238
- Timestamp:
- 03/12/07 19:20:55 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r2237 r2238 1122 1122 // should use classical approach here ... 1123 1123 #if BOUND_RENDERCOST 1124 const float rcLeft = std::max(objectsLeft, MIN_RENDERCOST); 1125 const float rcRight = std::max(objectsRight, MIN_RENDERCOST); 1126 1124 1127 const float sum = noValidSplit ? 1e25f : objectsLeft * al + objectsRight * ar; 1125 1128 #else 1126 const float rcLeft = std::max(objectsLeft, MIN_RENDERCOST);1127 const float rcRight = std::max(objectsRight, MIN_RENDERCOST);1128 1129 1129 1130 const float sum = noValidSplit ? 1e25f : objectsLeft * al + objectsRight * ar; 1130 1131 1131 #endif 1132 1132 /*cout << "pos=" << (*cit).mPos << "\t q=(" << objectsLeft << "," << objectsRight <<")\t r=(" … … 1373 1373 float volRight = totalVol; 1374 1374 1375 #if 1//USE_BETTER_RENDERCOST_EST1376 1375 const float nTotalObjects = EvalAbsCost(tData.mNode->mObjects); 1377 1376 float nObjectsLeft = 0; 1378 1377 float nObjectsRight = nTotalObjects; 1379 #else1380 const int nTotalObjects = (int)EvalAbsCost(tData.mNode->mObjects);1381 int nObjectsLeft = 0;1382 int nObjectsRight = (int)nTotalObjects;1383 #endif1384 1378 1385 1379 const float viewSpaceVol = … … 1440 1434 1441 1435 #if BOUND_RENDERCOST 1436 1437 const float rcLeft = max(nObjectsLeft, MIN_RENDERCOST); 1438 const float rcRight = max(nObjectsRight, MIN_RENDERCOST); 1439 1440 // the heuristics 1441 const float sum = noValidSplit ? 1442 1e25f : volLeft * (float)rcLeft + volRight * (float)rcRight; 1443 #else 1444 1442 1445 // the heuristics 1443 1446 const float sum = noValidSplit ? 1444 1447 1e25f : volLeft * (float)nObjectsLeft + volRight * (float)nObjectsRight; 1445 #else1446 const float rcLeft = max(nObjectsLeft, MIN_RENDERCOST);1447 const float rcRight = max(nObjectsRight, MIN_RENDERCOST);1448 1449 // the heuristics1450 const float sum = noValidSplit ?1451 1e25f : volLeft * (float)rcLeft + volRight * (float)rcRight;1452 1453 1448 #endif 1454 1449 … … 1792 1787 VssRayContainer::const_iterator rit, rit_end = rays.end(); 1793 1788 1789 VssRay *lastVssRay = NULL; 1790 1794 1791 VssRay::NewMail(); 1795 1792 … … 1798 1795 VssRay *ray = (*rit); 1799 1796 1800 if (ray->mTerminationObject) 1801 { 1802 ray->mTerminationObject->GetOrCreateRays()->push_back(ray); 1803 if (!ray->Mailed()) 1797 // filter out double rays (last ray the same as this ray 1798 if (!lastVssRay || 1799 !(ray->mOrigin == lastVssRay->mTermination) || 1800 !(ray->mTermination == lastVssRay->mOrigin)) 1801 { 1802 //cout << "j"; 1803 if (ray->mTerminationObject) 1804 1804 { 1805 ray->Mail(); 1806 ++ nRays; 1805 ray->mTerminationObject->GetOrCreateRays()->push_back(ray); 1806 if (!ray->Mailed()) 1807 { 1808 ray->Mail(); 1809 ++ nRays; 1810 } 1807 1811 } 1808 }1809 1812 1810 1813 #if COUNT_ORIGIN_OBJECTS 1811 1814 1812 if (ray->mOriginObject) 1813 { 1814 cout << "o"; 1815 ray->mOriginObject->GetOrCreateRays()->push_back(ray); 1816 1817 if (!ray->Mailed()) 1815 if (ray->mOriginObject) 1818 1816 { 1819 ray->Mail(); 1820 ++ nRays; 1817 //cout << "o"; 1818 ray->mOriginObject->GetOrCreateRays()->push_back(ray); 1819 1820 if (!ray->Mailed()) 1821 { 1822 ray->Mail(); 1823 ++ nRays; 1824 } 1821 1825 } 1822 1826 } -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r2237 r2238 215 215 Name="VCLinkerTool" 216 216 AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib RTScene.lib RTWorld.lib QtCore4.lib qtmain.lib cg.lib cgGL.lib QtOpenGL4.lib Qt3Support4.lib QtTest4.lib QtGui4.lib QtInterface.lib" 217 OutputFile="../bin/release/Preprocessor .exe"217 OutputFile="../bin/release/Preprocessor2.exe" 218 218 LinkIncremental="1" 219 219 AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release;"$(QTDIR)\lib";.\QtInterface\Release;"$(CG_LIB_PATH)"" -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r2237 r2238 902 902 903 903 int VspTree::EvalPvsEntriesIncr(VspSubdivisionCandidate &splitCandidate, 904 const float oldPvsSize,905 const float fPvsSize,906 const float bPvsSize) const904 const int oldPvsSize, 905 const int fPvsSize, 906 const int bPvsSize) const 907 907 { 908 908 … … 914 914 915 915 splitCandidate.mCorrectedFrontPvs = 916 mHierarchyManager->EvalCorrectedPvs( fPvsSize,917 correctedOldPvs,916 mHierarchyManager->EvalCorrectedPvs((float)fPvsSize, 917 (float)correctedOldPvs, 918 918 splitCandidate.GetAvgRaysPerObject()); 919 919 splitCandidate.mCorrectedBackPvs = 920 mHierarchyManager->EvalCorrectedPvs( bPvsSize,921 correctedOldPvs,920 mHierarchyManager->EvalCorrectedPvs((float)bPvsSize, 921 (float)correctedOldPvs, 922 922 splitCandidate.GetAvgRaysPerObject()); 923 923 924 splitCandidate.mFrontPvs = fPvsSize;925 splitCandidate.mBackPvs = bPvsSize;924 splitCandidate.mFrontPvs = (float)fPvsSize; 925 splitCandidate.mBackPvs = (float)bPvsSize; 926 926 927 927 if (0) … … 3059 3059 else 3060 3060 { 3061 //cout << "o"; 3061 3062 // store object only for one ray 3062 lastVssRay->mOriginObject = ray->mTerminationObject;3063 //lastVssRay->mOriginObject = ray->mTerminationObject; 3063 3064 } 3064 3065 }
Note: See TracChangeset
for help on using the changeset viewer.