- Timestamp:
- 02/01/07 11:18:15 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env
r2069 r2070 12 12 13 13 Preprocessor { 14 samplesPerPass 600000014 samplesPerPass 3000000 15 15 useGlRenderer false 16 16 type vss … … 19 19 loadMeshes false 20 20 # internal raycaster 21 #rayCastMethod 021 rayCastMethod 0 22 22 # intel raycaster 23 rayCastMethod 123 # rayCastMethod 1 24 24 exportVisibility false 25 25 loadKdTree false … … 190 190 VspBspTree { 191 191 Construction { 192 samples 900000192 samples 200000 193 193 epsilon 0.0000001 194 194 randomize false … … 238 238 minGlobalCostRatio 0.0001 239 239 240 maxViewCells 6000240 maxViewCells 3000 241 241 242 242 # used for pvs criterium -
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
r1999 r2070 10 10 #include "Halton.h" 11 11 #include "Triangle3.h" 12 #include "VssRay.h" 12 13 13 14 … … 566 567 } 567 568 #endif 569 570 int AxisAlignedBox3::IsInside(const VssRay &v) const 571 { 572 return IsInside(v.mTermination) && IsInside(v.mOrigin); 573 } 574 568 575 569 576 bool -
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h
r1999 r2070 13 13 class Polygon3; 14 14 class Mesh; 15 class VssRay; 15 16 struct Triangle3; 16 17 … … 122 123 virtual int IsInside(const Vector3 &v) const; 123 124 125 virtual int IsInside(const VssRay &v) const; 126 124 127 /** Test if the box makes sense. 125 128 */ -
GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.cpp
r2003 r2070 207 207 { 208 208 CastRay(*sit, vssRays, sbox, castDoubleRays, pruneInvalidRays); 209 if (!vssRays.empty() && (!vssRays.back() || !sbox.IsInside(*vssRays.back()))) 210 cout << "error " << *vssRays.back()<<endl; 209 211 } 210 212 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2069 r2070 1246 1246 1247 1247 SimpleRayContainer::const_iterator rit, rit_end = rays.end(); 1248 1248 cout << "here1 " << vssRays.size()<<endl; 1249 1249 SimpleRayContainer rayBucket; 1250 1250 int i = 0; … … 1276 1276 1277 1277 if ((int)rays.size() > 100000 && i % 100000 == 0) 1278 cout<<"\r"<<i<<"/"<<(int)rays.size()<<"\r"; 1279 } 1280 1278 cout << "here2 " << vssRays.size()<<endl; 1279 //cout<<"\r"<<i<<"/"<<(int)rays.size()<<"\r"; 1280 } 1281 cout << "here3 " << vssRays.size()<<endl; 1281 1282 // cast rest of rays 1282 1283 SimpleRayContainer::const_iterator sit, sit_end = rayBucket.end(); … … 1305 1306 cout << "here5 " << vssRays.size()<<endl; 1306 1307 1307 if (1) { 1308 int m = 850000; 1309 1310 if (1 && (int)rays.size() > m + 50) { 1308 1311 VssRayContainer tmpRays; 1309 int m = 700000; 1310 1312 1311 1313 for (int i=m; i < m+20; i++) { 1312 1314 if (vssRays[i]) 1313 tmpRays.push_back(vssRays[i]); 1315 {cout<<"e"; 1316 tmpRays.push_back(vssRays[i]); 1317 } 1318 else cout <<"d"; 1314 1319 } 1315 1320 ExportRays("sorted_rays2.x3d", tmpRays, 200); -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp
r2035 r2070 55 55 return false; 56 56 57 if (tmin >= 1.0f || tmax <= 0.0f)57 if (tmin >= 1.0f || tmax <= 0.0f) 58 58 return false; 59 59 … … 71 71 } 72 72 73 /** Checks if ray is valid, (e.g., not in empty view space or outside the view space) 73 /** Checks if ray is valid 74 (e.g., not in empty view space or outside the view space) 74 75 */ 75 76 bool … … 245 246 } 246 247 } 247 248 249 // r egardless of the pruneInvalidRays setting reject rays whic degenerate to a point248 249 // regardless of the pruneInvalidRays setting reject 250 // rays whic degenerate to a point 250 251 if (EpsilonEqualV3(hitA.mPoint, hitB.mPoint, Limits::Small)) { 251 252 return 0; 252 253 } 253 254 254 255 255 const bool validA = ValidateRay(simpleRay.mOrigin, simpleRay.mDirection, box, hitA); … … 264 264 // reset both contributions 265 265 if (!validA || !validB) { 266 if ( pruneInvalidRays)266 if (0 || pruneInvalidRays) 267 267 return 0; 268 268 … … 313 313 if (validA) 314 314 vssRay->mFlags |= VssRay::Valid; 315 316 315 317 316 vssRay->mDistribution = simpleRay.mDistribution; … … 327 326 #endif 328 327 329 if (castDoubleRay && (!pruneInvalidRays || hitB.mObject)) 330 { 331 VssRay *vssRay = mVssRayPool.Alloc(); 332 333 *vssRay = VssRay( 334 clipA, 335 hitB.mPoint, 336 hitA.mObject, 337 hitB.mObject, 338 mPreprocessor.mPass, 339 simpleRay.mPdf 340 ); 341 if (validB) 328 if (castDoubleRay && (!pruneInvalidRays || hitB.mObject)) 329 { 330 VssRay *vssRay = mVssRayPool.Alloc(); 331 332 *vssRay = VssRay( 333 clipA, 334 hitB.mPoint, 335 hitA.mObject, 336 hitB.mObject, 337 mPreprocessor.mPass, 338 simpleRay.mPdf 339 ); 340 341 if (validB) 342 342 vssRay->mFlags |= VssRay::Valid; 343 343 344 345 344 vssRay->mDistribution = simpleRay.mDistribution; 346 345 vssRay->mGeneratorId = simpleRay.mGeneratorId; … … 348 347 ++ hits; 349 348 //cout << "vssray 2: " << *vssRay << endl; 350 349 } 351 350 #if DEBUG_RAYCAST 352 351 Debug<<"PR4"<<flush; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r2069 r2070 331 331 ExtractPolygons(object, polys); 332 332 333 mBoundingBox.Include(object->GetBox()); // add to BSP tree aabb 333 // add to BSP tree aabb 334 mBoundingBox.Include(object->GetBox()); 334 335 } 335 336 … … 427 428 VssRayContainer::const_iterator rit, rit_end = sampleRays.end(); 428 429 430 ///////// 429 431 //-- store rays 430 432 for (rit = sampleRays.begin(); rit != rit_end; ++ rit) … … 928 930 if (1) 929 931 { 930 float cFront = (float)tFrontData.mPvs * tFrontData.mProbability; 931 float cBack = (float)tBackData.mPvs * tBackData.mProbability; 932 float cData = (float)tData.mPvs * tData.mProbability; 933 932 const float cFront = (float)tFrontData.mPvs * tFrontData.mProbability; 933 const float cBack = (float)tBackData.mPvs * tBackData.mProbability; 934 const float cData = (float)tData.mPvs * tData.mProbability; 934 935 935 float costDecr =936 const float costDecr = 936 937 (cFront + cBack - cData) / mBoundingBox.GetVolume(); 937 938 … … 946 947 } 947 948 948 949 //////////// 949 950 //-- push the new split candidates on the stack 951 950 952 VspBspSubdivisionCandidate frontCandidate; 951 953 frontCandidate.mParentData = tFrontData; … … 957 959 EvalSubdivisionCandidate(backCandidate); 958 960 961 cout << "f cost: " << frontCandidate.mPriority << endl; 962 cout << "b cost: " << backCandidate.mPriority << endl; 959 963 tQueue.push(frontCandidate); 960 964 tQueue.push(backCandidate); … … 1017 1021 leaf->mProbability = tData.mProbability; 1018 1022 1019 // finally evaluate stats untilthis leaf1020 if ( 0)1023 // finally evaluate stats for this leaf 1024 if (1) 1021 1025 EvaluateLeafStats(tData); 1022 1026 } … … 1299 1303 mLocalSubdivisionCandidates->clear(); 1300 1304 1301 int requestedSize = 2 * (int)(rays.size()); 1305 const int requestedSize = 2 * (int)(rays.size()); 1306 1302 1307 // creates a sorted split candidates array 1303 1308 if (mLocalSubdivisionCandidates->capacity() > 500000 && … … 1325 1330 if (0) ClipValue(pos, minBand, maxBand); 1326 1331 1327 mLocalSubdivisionCandidates->push_back(SortableEntry(positive ? SortableEntry::ERayMin : SortableEntry::ERayMax, 1332 mLocalSubdivisionCandidates-> 1333 push_back(SortableEntry(positive ? SortableEntry::ERayMin : SortableEntry::ERayMax, 1328 1334 pos, (*ri).mRay)); 1329 1335 … … 1333 1339 if (0) ClipValue(pos, minBand, maxBand); 1334 1340 1335 mLocalSubdivisionCandidates->push_back(SortableEntry(positive ? SortableEntry::ERayMax : SortableEntry::ERayMin, 1341 mLocalSubdivisionCandidates-> 1342 push_back(SortableEntry(positive ? SortableEntry::ERayMax : SortableEntry::ERayMin, 1336 1343 pos, (*ri).mRay)); 1337 1344 } 1338 1345 1339 s table_sort(mLocalSubdivisionCandidates->begin(), mLocalSubdivisionCandidates->end());1346 sort(mLocalSubdivisionCandidates->begin(), mLocalSubdivisionCandidates->end()); 1340 1347 } 1341 1348
Note: See TracChangeset
for help on using the changeset viewer.