Changeset 2161 for GTP/trunk/Lib/Vis
- Timestamp:
- 02/23/07 13:54:56 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r2160 r2161 1817 1817 return false; 1818 1818 } 1819 1820 1821 #if 0 1819 //----------------------------------------------------------------------- 1822 1820 void OcclusionCullingSceneManager::RenderDepthPass() 1823 1821 { 1822 // create material for depth pass 1823 InitDepthPass(); 1824 1824 1825 //////////////////// 1825 1826 //-- hierarchical culling 1826 1827 // exclude these queues from hierarchical rendering1828 clearSpecialCaseRenderQueues();1829 addSpecialCaseRenderQueue(RENDER_QUEUE_BACKGROUND);1830 addSpecialCaseRenderQueue(RENDER_QUEUE_SKIES_EARLY);1831 addSpecialCaseRenderQueue(RENDER_QUEUE_SKIES_LATE);1832 addSpecialCaseRenderQueue(RENDER_QUEUE_OVERLAY);1833 setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE);1834 1827 1835 1828 // set all necessary parameters for … … 1850 1843 // all which are not in mLeavePassesInQueue) 1851 1844 _deleteRenderedQueueGroups(mLeavePassesInQueue); 1852 1853 /////////////1854 //-- reset parameters needed for special rendering1855 1856 mIsDepthPassPhase = false;1857 mIsItemBufferPhase = false;1858 mSkipTransparents = false;1859 mIsHierarchicalCulling = false;1860 1861 mLeavePassesInQueue = 0;1862 1863 /////////////1864 //-- now we can render all remaining queue objects1865 //-- used for depth pass, transparents, overlay1866 clearSpecialCaseRenderQueues();1867 1868 // the shaded geometry is rendered in a second pass1869 // add visible nodes found by the visibility culling algorithm1870 NodeList::const_iterator it, it_end = mVisible.end();1871 1872 if(1)1873 for (it = mVisible.begin(); it != it_end; ++ it)1874 {1875 (*it)->_addToRenderQueue(mCameraInProgress, getRenderQueue(), false);1876 }1877 }1878 #endif1879 void OcclusionCullingSceneManager::RenderDepthPass()1880 {1881 InitDepthPass(); // create material for depth pass1882 1883 ////////////////////1884 //-- hierarchical culling1885 1886 // set all necessary parameters for1887 // hierarchical visibility culling and rendering1888 InitVisibilityCulling(mCameraInProgress);1889 1890 1891 /**1892 * the hierarchical culling algorithm1893 * for depth pass: we just find objects and update depth buffer1894 * for "delayed" rendering: we render some passes afterwards1895 * e.g., transparents, because they need front-to-back sorting1896 **/1897 1898 mVisibilityManager->ApplyVisibilityCulling();1899 1900 // delete remaining renderables from queue1901 //_deleteRenderedQueueGroups();1902 getRenderQueue()->clear();1903 1845 1904 1846 ///////////// -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2117 r2161 621 621 622 622 // HACK 623 if (mRayCaster->mVssRayPool.mIndex > mSamplesPerPass)623 /*if (mRayCaster->mVssRayPool.mIndex > mSamplesPerPass) 624 624 { 625 625 cout << "warning: new samples: " << castSamples << " " << "queue: " << (int)mRayQueue.size() << endl; 626 626 Debug << "warning: new samples: " << castSamples << " " << "queue: " << (int)mRayQueue.size() << endl; 627 } 627 }*/ 628 628 629 629 return castSamples; -
GTP/trunk/Lib/Vis/Preprocessing/src/HashPvs.h
r2146 r2161 2 2 #define __HASHPVS_H 3 3 4 //#include <hash_map> 4 5 5 #include <hash_set> 6 6 #include "common.h" 7 7 #include <math.h> 8 8 #include "PvsBase.h" 9 #include "google/dense_hash_set" 9 10 10 11 … … 25 26 size_t operator()(T a) const 26 27 { 27 size_t h = (size_t)(a->GetId());// % 2000; 28 //for (; *s; ++s) 29 // h = 5 * h + *s; 30 return h; 28 return (size_t)(a->GetId()); 31 29 } 32 30 … … 37 35 }; 38 36 39 /* 40 template<typename T> 41 struct gt 42 { 43 bool operator() (T s1, T s2) const 44 { 45 return s1 > s2; 46 } 47 }; 48 */ 49 //#define HASH_SET stdext::hash_set<T, stdext::hash_compare<T, gt<T> > > 50 #define HASH_SET stdext::hash_set<T, my_hash_compare<T> > 37 38 #define HASH_SET google::dense_hash_set<T, my_hash_compare<T> > 39 //#define HASH_SET stdext::hash_set<T, my_hash_compare<T> > 40 #define HASH_ITERATOR HASH_SET::iterator 41 #define CONST_HASH_ITERATOR HASH_SET::const_iterator 51 42 52 43 /** Iterator over a hash pvs. … … 59 50 HashPvsIterator<T, S>() {} 60 51 61 HashPvsIterator<T, S>(const typename HASH_SET::const_iterator&itCurrent,62 const typename HASH_SET::const_iterator&itEnd):52 HashPvsIterator<T, S>(const typename CONST_HASH_ITERATOR &itCurrent, 53 const typename CONST_HASH_ITERATOR &itEnd): 63 54 mItCurrent(itCurrent), mItEnd(itEnd) 64 55 { … … 72 63 T Next(S &pdf) 73 64 { 74 // hack: create new pvs entry 75 return *(mItCurrent) ++; 65 T sample = *mItCurrent; 66 ++ mItCurrent; 67 68 return sample; 76 69 } 77 70 78 71 T Next() 79 72 { 80 // hack: create new pvs entry 81 return *(mItCurrent) ++; 73 T sample = *mItCurrent; 74 ++ mItCurrent; 75 76 return sample; 82 77 } 83 78 84 79 private: 85 typename HASH_SET::const_iteratormItCurrent;86 typename HASH_SET::const_iteratormItEnd;80 typename CONST_HASH_ITERATOR mItCurrent; 81 typename CONST_HASH_ITERATOR mItEnd; 87 82 }; 88 83 … … 139 134 it would be added in the sorted vector. 140 135 */ 141 bool Find(T sample, typename HASH_SET::iterator&it);136 inline bool Find(T sample, typename HASH_ITERATOR &it); 142 137 143 138 typename HashPvsIterator<T, S> GetIterator() const; … … 210 205 211 206 template <typename T, typename S> 212 bool HashPvs<T, S>::Find(T sample, typename HASH_ SET::iterator&it)207 bool HashPvs<T, S>::Find(T sample, typename HASH_ITERATOR &it) 213 208 { 214 209 it = mEntries.find(sample); … … 216 211 // already in map 217 212 return (it != mEntries.end()); 213 return false; 218 214 } 219 215 … … 236 232 float HashPvs<T, S>::AddSample(T sample, const float pdf) 237 233 { 238 static HASH_ SET::iteratorit;234 static HASH_ITERATOR it; 239 235 240 236 if (Find(sample, it)) … … 256 252 void HashPvs<T, S>::AddSampleDirty(T sample, const float pdf) 257 253 { 258 static HASH_ SET::iteratorit;254 static HASH_ITERATOR it; 259 255 260 256 // not yet in map … … 272 268 const float pdf) 273 269 { 274 /*pair<HASH_ SET::iterator, bool> p = mEntries.insert(sample);270 /*pair<HASH_ITERATOR, bool> p = mEntries.insert(sample); 275 271 276 272 // already in map 277 273 return p.second; 278 274 */ 279 static HASH_ SET::iteratorit;275 static HASH_ITERATOR it; 280 276 281 277 // already in map … … 375 371 const HashPvs<T, S> &b) 376 372 { 377 HASH_SET::const_iteratorait, ait_end = a.mEntries.end();373 CONST_HASH_ITERATOR ait, ait_end = a.mEntries.end(); 378 374 379 375 for (ait = a.mEntries.begin(); ait != ait_end; ++ ait) … … 382 378 } 383 379 384 HASH_SET::const_iteratorbit, bit_end = b.mEntries.end();380 CONST_HASH_ITERATOR bit, bit_end = b.mEntries.end(); 385 381 386 382 for (bit = b.mEntries.begin(); bit != bit_end; ++ bit) … … 389 385 } 390 386 391 //cerr << "not implemented" << endl;392 387 } 393 388 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
r2160 r2161 20 20 Name="VCCLCompilerTool" 21 21 Optimization="0" 22 AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;Timer "23 PreprocessorDefinitions="WIN32;_DEBUG;_LIB "22 AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;Timer;..\src\sparsehash\src;..\src\sparsehash\src\windows;..\src\sparsehash\src\google;..\src\sparsehash\src\google\sparsehash" 23 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NO_QT" 24 24 MinimalRebuild="TRUE" 25 25 BasicRuntimeChecks="3" … … 221 221 OptimizeForProcessor="3" 222 222 OptimizeForWindowsApplication="TRUE" 223 AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\QtOpenGl";"$(CG_INC_PATH)";Timer "223 AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\QtOpenGl";"$(CG_INC_PATH)";Timer;..\src\ootl\src\;..\src\ootl\src\cpp;..\src\ootl\src\include\ootl\sandbox;..\src\ootl\;..\src\ootl\src\include\ootl;..\src\sparsehash\src\google\sparsehash;..\src\sparsehash\src\windows;..\src\sparsehash\src\google;..\src\sparsehash\src" 224 224 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_HASH_PVS" 225 225 ExceptionHandling="TRUE" … … 489 489 <File 490 490 RelativePath=".\HashPvs.h"> 491 </File> 492 <File 493 RelativePath=".\HashPvs2.h"> 491 494 </File> 492 495 <File … … 1040 1043 </File> 1041 1044 </Filter> 1045 <Filter 1046 Name="ootl" 1047 Filter=""> 1048 <Filter 1049 Name="include" 1050 Filter=""> 1051 <File 1052 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_adapters.hpp"> 1053 </File> 1054 <File 1055 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_benchmark.hpp"> 1056 </File> 1057 <File 1058 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_bool_stack.hpp"> 1059 </File> 1060 <File 1061 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_dictionary.hpp"> 1062 </File> 1063 <File 1064 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_fft.hpp"> 1065 </File> 1066 <File 1067 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_fft_test.hpp"> 1068 </File> 1069 <File 1070 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_functions.hpp"> 1071 </File> 1072 <File 1073 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_generators.hpp"> 1074 </File> 1075 <File 1076 RelativePath=".\ootl\src\include\ootl\ootl_hash.hpp"> 1077 </File> 1078 <File 1079 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_iterable.hpp"> 1080 </File> 1081 <File 1082 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_iterators.hpp"> 1083 </File> 1084 <File 1085 RelativePath=".\ootl\src\include\ootl\ootl_list.hpp"> 1086 </File> 1087 <File 1088 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_map.hpp"> 1089 </File> 1090 <File 1091 RelativePath=".\ootl\src\include\ootl\ootl_misc.hpp"> 1092 </File> 1093 <File 1094 RelativePath=".\ootl\src\include\ootl\mswin\ootl_mswin.hpp"> 1095 </File> 1096 <File 1097 RelativePath=".\ootl\src\include\ootl\mswin\ootl_mswin_console.hpp"> 1098 </File> 1099 <File 1100 RelativePath=".\ootl\src\include\ootl\mswin\ootl_mswin_gdi.hpp"> 1101 </File> 1102 <File 1103 RelativePath=".\ootl\src\include\ootl\mswin\ootl_mswin_simple_win.hpp"> 1104 </File> 1105 <File 1106 RelativePath=".\ootl\src\include\ootl\ootl_object.hpp"> 1107 </File> 1108 <File 1109 RelativePath=".\ootl\src\include\ootl\ootl_output.hpp"> 1110 </File> 1111 <File 1112 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_polar.hpp"> 1113 </File> 1114 <File 1115 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_predicate.hpp"> 1116 </File> 1117 <File 1118 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_procedure.hpp"> 1119 </File> 1120 <File 1121 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_ptr.hpp"> 1122 </File> 1123 <File 1124 RelativePath=".\ootl\src\include\ootl\ootl_stack.hpp"> 1125 </File> 1126 <File 1127 RelativePath=".\ootl\src\include\ootl\ootl_string.hpp"> 1128 </File> 1129 <File 1130 RelativePath=".\ootl\src\include\ootl\ootl_string_utils.hpp"> 1131 </File> 1132 <File 1133 RelativePath=".\ootl\src\include\ootl\ootl_tester.hpp"> 1134 </File> 1135 <File 1136 RelativePath=".\ootl\src\include\ootl\ootl_timer.hpp"> 1137 </File> 1138 <File 1139 RelativePath=".\ootl\src\include\ootl\sandbox\ootl_valarray.hpp"> 1140 </File> 1141 <File 1142 RelativePath=".\ootl\src\include\ootl\ootl_vlist.hpp"> 1143 </File> 1144 </Filter> 1145 </Filter> 1146 <Filter 1147 Name="google" 1148 Filter=""> 1149 <File 1150 RelativePath=".\sparsehash\src\google\sparsehash\config.h"> 1151 </File> 1152 <File 1153 RelativePath=".\sparsehash\src\google\sparsehash\densehashtable.h"> 1154 </File> 1155 <File 1156 RelativePath=".\sparsehash\src\windows\hash_fun.h"> 1157 </File> 1158 <File 1159 RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h"> 1160 </File> 1161 <File 1162 RelativePath=".\sparsehash\src\windows\hash_map.h"> 1163 </File> 1164 <File 1165 RelativePath=".\sparsehash\src\google\sparsehash\sparsehashtable.h"> 1166 </File> 1167 <File 1168 RelativePath=".\sparsehash\src\windows\stl_hash_fun.h"> 1169 </File> 1170 </Filter> 1042 1171 <File 1043 1172 RelativePath=".\VTune\Preprocessor.vpj"> -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
r2077 r2161 79 79 // pool of vss rays to be used in one pass of the sampling 80 80 struct VssRayPool { 81 VssRayPool():mRays(NULL), mIndex(0), mNumber(0) {} 82 ~VssRayPool() { 83 if (mRays) 84 delete mRays; 81 VssRayPool(): mRays(NULL), mIndex(0), mNumber(0) 82 {} 83 84 ~VssRayPool() 85 { 86 DEL_PTR(mRays); 85 87 } 86 88 87 89 void Reserve(const int number) { 88 if (mRays)89 delete mRays;90 90 cout<<"here3"<<endl; 91 //DEL_PTR(mRays); 92 cout<<"here44"<<endl; 91 93 mRays = new VssRay[number]; 92 94 mNumber = number; … … 102 104 return mRays + mIndex ++; 103 105 } 104 106 protected: 105 107 VssRay *mRays; 106 108 int mIndex; … … 154 156 155 157 /** Checks if ray is valid. 156 I.e., the ray is in valid view space.157 @note: clamps the ray to valid view space.158 I.e., the ray is in valid view space. 159 @note: clamps the ray to valid view space. 158 160 */ 159 161 bool ValidateRay(const Vector3 &origin, -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r2146 r2161 20 20 Name="VCCLCompilerTool" 21 21 Optimization="0" 22 AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost "22 AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\src\sparsehash\src\" 23 23 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NO_QT" 24 24 MinimalRebuild="TRUE" … … 198 198 OptimizeForProcessor="3" 199 199 OptimizeForWindowsApplication="TRUE" 200 AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;"$(QTDIR)\include\QtOpenGl";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtCore";"$(QTDIR)\include";QtInterface "200 AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;"$(QTDIR)\include\QtOpenGl";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtCore";"$(QTDIR)\include";QtInterface;..\src\sparsehash\src\;$(NOINHERIT)" 201 201 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_HASH_PVS" 202 202 ExceptionHandling="TRUE" -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2130 r2161 26 26 27 27 #include "PerfTimer.h" 28 29 28 30 29 -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r2117 r2161 20 20 #include "SceneGraph.h" 21 21 #include "GlobalLinesRenderer.h" 22 #include "PvsDefinitions.h"22 //#include "PvsDefinitions.h" 23 23 24 24 #include "ViewCellsManager.h"
Note: See TracChangeset
for help on using the changeset viewer.