Changeset 2583 for GTP/trunk/Lib/Vis/Preprocessing/src
- Timestamp:
- 01/09/08 14:29:56 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HavranRayCaster.cpp
r2582 r2583 70 70 // ray shooting is computed ! 71 71 void HavranRayCaster::CastRaysPacket4(Vector3 &boxmax, 72 73 74 75 76 72 Vector3 &boxmin, 73 Vector3 origin4[], 74 Vector3 direction4[], 75 int result4[], 76 float dist4[]) 77 77 { 78 78 #ifdef USE_HAVRAN_RAYCASTER … … 81 81 raypack.SetLoc(i, origin4[i]); 82 82 raypack.SetDir(i, direction4[i]); 83 } 84 83 } 84 85 85 // The same operations for packets of rays, if implemented by 86 86 // a particular ASDS, otherwise it is emulated by decomposition … … 93 93 Intersectable* intersectable; 94 94 if ( (intersectable = raypack.GetObject(i)) ) 95 result4[i] = (int)intersectable; 96 } 97 95 // $$JB this is very hacky - > should be replaced with fetching the index of the triangle 96 result4[i] = (int)intersectable; 97 } 98 98 99 return; 99 100 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
r2582 r2583 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1.2) on: st 9. I 1 1:11:4920083 # Generated by qmake (2.00a) (Qt 4.1.2) on: st 9. I 13:30:43 2008 4 4 # Project: preprocessor.pro 5 5 # Template: app -
GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp
r2582 r2583 28 28 29 29 // VH - commened out !!!!! 8/1/2008 30 //#define SORT_RAY_ENTRIES 130 #define SORT_RAY_ENTRIES 1 31 31 32 32 // use avg ray contribution as importance … … 278 278 { 279 279 #if 0 280 Vector3 v;281 // mutate the termination282 if (d.DrivingAxis() == 0)283 v = Vector3(0, r[2]-0.5f, r[3]-0.5f);284 else285 if (d.DrivingAxis() == 1)286 v = Vector3(r[2]-0.5f, 0, r[3]-0.5f);287 else288 v = Vector3(r[2]-0.5f, r[3]-0.5f, 0);289 290 // Vector3 nv;291 292 // if (Magnitude(v) > Limits::Small)293 // nv = Normalize(v);294 // else295 // nv = v;296 297 // v = nv*size + v*size;298 299 return v*(4.0f*radius);300 #endif301 #if 0302 280 return (U*(vr2.xx - 0.5f) + V*(vr2.yy - 0.5f))*(4.0f*radius); 303 281 #endif … … 388 366 preprocessor->mRayCaster->CastRaysPacket4(box.Min(), 389 367 box.Max(), 390 origs, dirs, 368 origs, 369 dirs, 391 370 hit_triangles, 392 371 dist); 393 372 394 373 for (i=0; i < packetSize; i++) { 374 //cout<<hit_triangles[i]<<endl; 395 375 if (hit_triangles[i] == -1) { 396 376 // break on first passing ray 397 377 break; 398 378 } … … 771 751 Environment::GetSingleton()->GetIntValue("Preprocessor.rayCastMethod", 772 752 rayCaster); 773 useEnhancedFeatures = (rayCaster ==774 RayCaster::INTE L_RAYCASTER);753 useEnhancedFeatures = (rayCaster != 754 RayCaster::INTERNAL_RAYCASTER); 775 755 #else 776 756 useEnhancedFeatures = false; -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2582 r2583 1 1 2 #include "SceneGraph.h" 2 3 #include "Exporter.h" … … 20 21 #include "VssRay.h" 21 22 #include "IntelRayCaster.h" 22 #if TODO23 23 #include "HavranRayCaster.h" 24 #endif25 24 #include "InternalRayCaster.h" 26 25 #include "GlobalLinesRenderer.h" … … 415 414 416 415 vector<FaceParentInfo> *fi = 417 ((rayCastMethod == RayCaster::INTEL_RAYCASTER) && mLoadMeshes) ? 416 ((rayCastMethod == RayCaster::INTEL_RAYCASTER || 417 rayCastMethod == RayCaster::HAVRAN_RAYCASTER 418 ) && mLoadMeshes) ? 418 419 &mFaceParents : NULL; 419 420 420 421 if (files == 1) 421 422 { … … 1047 1048 bool Preprocessor::LoadInternKdTree(const string &internKdTree) 1048 1049 { 1049 bool mUseKdTree = true; 1050 1051 if (!mUseKdTree) { 1052 // create just a dummy KdTree 1053 mKdTree = new KdTree; 1054 return true; 1055 } 1056 1057 int rayCastMethod; 1058 Environment::GetSingleton()-> 1059 GetIntValue("Preprocessor.rayCastMethod", rayCastMethod); 1060 1061 if (rayCastMethod == 2) { 1062 //HavranRayCaster *hr = 1063 // dynamic_cast<HavranRayCaster*>(mRayCaster); 1064 #if TODO 1065 HavranRayCaster *hr = 1066 reinterpret_cast<HavranRayCaster*>(mRayCaster); 1067 hr->Build(this->mObjects); 1068 #endif 1069 return true; 1070 } 1071 1072 // always try to load the kd tree 1073 cout << "loading kd tree file " << internKdTree << " ... " << endl; 1074 1075 if (!LoadKdTree(internKdTree)) { 1076 cout << "error loading kd tree with filename " 1077 << internKdTree << ", rebuilding it instead ... " << endl; 1078 // build new kd tree from scene geometry 1079 BuildKdTree(); 1080 1081 // export kd tree? 1082 const long startTime = GetTime(); 1083 cout << "exporting kd tree ... "; 1084 1085 if (!ExportKdTree(internKdTree)) 1086 { 1087 cout << " error exporting kd tree with filename " 1088 << internKdTree << endl; 1089 } 1090 else 1091 { 1092 cout << "finished in " 1093 << TimeDiff(startTime, GetTime()) * 1e-3 1094 << " secs" << endl; 1095 } 1096 } 1097 1098 KdTreeStatistics(cout); 1099 cout << mKdTree->GetBox() << endl; 1100 1050 bool mUseKdTree = true; 1051 1052 1053 int rayCastMethod; 1054 Environment::GetSingleton()-> 1055 GetIntValue("Preprocessor.rayCastMethod", rayCastMethod); 1056 1057 if (rayCastMethod == 2) { 1058 //HavranRayCaster *hr = 1059 // dynamic_cast<HavranRayCaster*>(mRayCaster); 1060 HavranRayCaster *hr = 1061 reinterpret_cast<HavranRayCaster*>(mRayCaster); 1062 hr->Build(this->mObjects); 1063 // $$ do not exit here, so that the "internal" kD-tree used 1064 // other puroposes can be loaded 1065 // return true; 1066 } 1067 1068 1069 if (!mUseKdTree) { 1070 // create just a dummy KdTree 1071 mKdTree = new KdTree; 1101 1072 return true; 1073 } 1074 1075 1076 1077 // always try to load the kd tree 1078 cout << "loading kd tree file " << internKdTree << " ... " << endl; 1079 1080 if (!LoadKdTree(internKdTree)) { 1081 cout << "error loading kd tree with filename " 1082 << internKdTree << ", rebuilding it instead ... " << endl; 1083 // build new kd tree from scene geometry 1084 BuildKdTree(); 1085 1086 // export kd tree? 1087 const long startTime = GetTime(); 1088 cout << "exporting kd tree ... "; 1089 1090 if (!ExportKdTree(internKdTree)) 1091 { 1092 cout << " error exporting kd tree with filename " 1093 << internKdTree << endl; 1094 } 1095 else 1096 { 1097 cout << "finished in " 1098 << TimeDiff(startTime, GetTime()) * 1e-3 1099 << " secs" << endl; 1100 } 1101 } 1102 1103 KdTreeStatistics(cout); 1104 cout << mKdTree->GetBox() << endl; 1105 1106 return true; 1102 1107 } 1103 1108 … … 1154 1159 if (rayCastMethod == 2) 1155 1160 { 1156 #if TODO 1157 cout << "ray cast method: havran" << endl; 1161 cout << "ray cast method: havran" << endl <<flush; 1158 1162 mRayCaster = new HavranRayCaster(*this); 1159 #endif1160 1163 } 1161 1164 … … 1206 1209 cout << "reserving " << reserveRays << " rays " << endl; 1207 1210 mRayCaster->ReserveVssRayPool(reserveRays); 1208 1211 cout<<"done."<<endl<<flush; 1209 1212 return true; 1210 1213 } … … 1223 1226 1224 1227 // !!!!!!!!!!!!!!!! VH no sorting 1225 if ( 0 &&1228 if ( 1226 1229 rays.size() > 10000) 1227 1230 { … … 1263 1266 #endif 1264 1267 } 1265 // cerr<<"Determining PVS objects"<<endl; 1268 1269 cerr<<"Determining PVS objects"<<endl; 1266 1270 DeterminePvsObjects(vssRays); 1271 cerr<<"done."<<endl; 1272 1267 1273 } 1268 1274 -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp
r2575 r2583 14 14 15 15 RayCaster::RayCaster(const Preprocessor &preprocessor): 16 mPreprocessor(preprocessor)16 mVssRayPool(), mPreprocessor(preprocessor) 17 17 { 18 18 } … … 270 270 int 271 271 RayCaster::ProcessRay(const SimpleRay &simpleRay, 272 273 274 275 276 277 272 Intersection &hitA, 273 Intersection &hitB, 274 VssRayContainer &vssRays, 275 const AxisAlignedBox3 &box, 276 const bool castDoubleRay, 277 const bool pruneInvalidRays) 278 278 { 279 279 int hits = 0; -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
r2582 r2583 2 2 #define _RayCaster_H__ 3 3 4 4 5 #include "Containers.h" 5 6 #include <string> 7 #include <iostream> 6 8 #include "Vector3.h" 7 9 #include "VssRay.h" 10 11 using namespace std; 8 12 9 13 // -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2575 r2583 687 687 688 688 689 Intersectable *ViewCellsManager::GetIntersectable(const VssRay &ray, const bool isTermination) const 689 Intersectable *ViewCellsManager::GetIntersectable(const VssRay &ray, 690 const bool isTermination) const 690 691 { 691 692 if (mUseKdPvs) -
GTP/trunk/Lib/Vis/Preprocessing/src/common.h
r2582 r2583 29 29 30 30 31 31 #if defined(_MSC_VER) 32 // define __SSE__ macro as it is not defined under MSVC 33 #define __SSE__ 34 #endif 32 35 33 36 // This constant should be used for the length of the array char for filenames -
GTP/trunk/Lib/Vis/Preprocessing/src/default.env
r2582 r2583 40 40 totalSamples 250000000 41 41 # totalSamples 2000000 42 samplesPerPass 100000042 samplesPerPass 500000 43 43 samplesPerEvaluation 5000000 44 44 … … 53 53 useGlDebugger false 54 54 # 0 = INTERNAL 1 = MLRT 2 = HAVRAN 55 rayCastMethod 155 rayCastMethod 2 56 56 57 57 # type sampling … … 106 106 # distributions rss+spatial+object_direction 107 107 # distributions rss+object_direction+spatial+object+direction 108 distributions mutation+spatial+object_direction +filter_based108 distributions mutation+spatial+object_direction 109 109 # distributions rss+object_direction 110 110 # distributions object_direction … … 202 202 importRandomViewCells false 203 203 204 useKdPvs true204 useKdPvs false 205 205 useKdPvsAfterFiltering true 206 206 # samples used for view cell construction -
GTP/trunk/Lib/Vis/Preprocessing/src/havran/ktbftrav.cpp
r2582 r2583 990 990 results[i].tdist; 991 991 } // for i 992 return 0; 992 993 } 993 994 #endif … … 1338 1339 CKTBTraversal::FindNearestI(RayPacket2x2 &rp, Vector3 &boxmin, Vector3 &boxmax) 1339 1340 { 1341 1340 1342 static AxisAlignedBox3 localbox; 1341 1343 localbox.SetMin(boxmin); 1342 1344 localbox.SetMax(boxmax); 1343 1345 1346 #define USE_SIMPLE_VERSION 1 1347 1348 #if !USE_SIMPLE_VERSION 1344 1349 int m1 = _mm_movemask_ps(rp.dx4); 1345 1350 if ((m1 == 0)||(m1 == 15)) { … … 1514 1519 return; 1515 1520 }}} 1516 1521 #endif 1517 1522 // Trace ray by ray 1518 1523 SimpleRay ray; -
GTP/trunk/Lib/Vis/Preprocessing/src/havran/ktbtrav.h
r2582 r2583 311 311 } 312 312 // $$JB correction 313 virtual int FindNearestI_16oneDir(SimpleRayContainer &rays, int offset) { 314 return 0; 315 } 313 virtual int FindNearestI_16oneDir(SimpleRayContainer &rays, int offset); 314 316 315 int PrecomputeData(SimpleRayContainer &rays); 317 316 void ReverseRay(const int indexA); -
GTP/trunk/Lib/Vis/Preprocessing/src/havran/raypack.h
r2582 r2583 22 22 #include "Vector3.h" 23 23 24 // $$JB __SSE__ macro not define in _WIN32 25 //#ifdef __SSE__ 26 #if 1 24 #ifdef __SSE__ 27 25 28 26 // System headers for SSE -
GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro
r2582 r2583 85 85 CONFIG(qt) { 86 86 win32:LIBS += cg.lib cgGL.lib 87 #DEFINES += USE_QT87 DEFINES += USE_QT 88 88 } 89 89 -
GTP/trunk/Lib/Vis/Preprocessing/src/run_test2
r2582 r2583 3 3 4 4 #COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 5 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish + -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=500000 -total_samples=6000000"5 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=500000 -total_samples=20000000" 6 6 7 7
Note: See TracChangeset
for help on using the changeset viewer.