Changeset 1824 for GTP/trunk/Lib
- Timestamp:
- 11/28/06 19:46:36 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
r1772 r1824 2310 2310 } 2311 2311 2312 2313 } 2314 2312 Vector3 2313 AxisAlignedBox3::GetUniformRandomSurfacePoint() const 2314 { 2315 // get face based on its surface area 2316 float pdf[7]; 2317 pdf[0] = 0.0f; 2318 int i; 2319 for (i=0; i < 6; i++) { 2320 pdf[i+1] = pdf[i] + GetFace(i).GetArea(); 2321 } 2322 2323 float x = RandomValue(0, pdf[6]); 2324 for (i=0; i < 6; i++) { 2325 if (x < pdf[i]) 2326 break; 2327 } 2328 2329 const int idx = i-1; 2330 2331 const Rectangle3 face = GetFace(idx); 2332 2333 Vector3 point = Vector3(0,0,0); 2334 float sum = 0.0f; 2335 2336 for (i = 0; i < 4; ++ i) 2337 { 2338 const float r = RandomValue(0, 1); 2339 sum += r; 2340 point += face.mVertices[i] * r; 2341 } 2342 2343 point *= 1.0f / sum; 2344 2345 //normal = face.GetNormal(); 2346 2347 return point; 2348 } 2349 2350 2351 } 2352 -
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h
r1772 r1824 183 183 Vector3 GetRandomPoint() const; 184 184 Vector3 GetRandomSurfacePoint() const; 185 Vector3 GetUniformRandomSurfacePoint() const; 185 186 186 187 Vector3 GetPoint(const Vector3 &p) const { -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r1785 r1824 56 56 }; 57 57 58 struct PvsCache { 59 PvsCache():mViewCell(NULL) {} 60 void Reset() { mViewCell = NULL; mPvs.Clear(); filteredBoxes.clear(); } 61 ViewCell *mViewCell; 62 ObjectPvs mPvs; 63 vector<AxisAlignedBox3> filteredBoxes; 64 }; 65 66 58 67 struct RenderCostSample { 59 68 … … 147 156 protected: 148 157 158 PvsCache mPvsCache; 149 159 150 160 vector<OcclusionQuery *> mOcclusionQueries; -
GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.cpp
r1584 r1824 22 22 23 23 int InternalRayCaster::CastRay(const SimpleRay &simpleRay, 24 VssRayContainer &vssRays, 25 const AxisAlignedBox3 &box, 26 const bool castDoubleRay, 27 const bool pruneInvalidRays 28 ) 29 { 30 //cout << "internal ray" << endl; 24 VssRayContainer &vssRays, 25 const AxisAlignedBox3 &box, 26 const bool castDoubleRay, 27 const bool pruneInvalidRays 28 ) 29 { 30 if (simpleRay.mType == Ray::GLOBAL_RAY) 31 return CastGlobalRay(simpleRay, vssRays, box, pruneInvalidRays); 32 33 //cout << "internal ray" << endl; 31 34 static Ray ray; 32 35 int hits = 0; … … 53 56 } 54 57 55 mPreprocessor.SetupRay(ray, simpleRay.mOrigin, -simpleRay.mDirection);56 ray.mFlags &= ~Ray::CULL_BACKFACES;57 58 58 59 if (castDoubleRay && mKdTree->CastRay(ray)) 59 { 60 hitB.mObject = ray.intersections[0].mObject; 61 hitB.mPoint = ray.Extrap(ray.intersections[0].mT); 62 hitB.mNormal = ray.intersections[0].mNormal; 60 { 61 mPreprocessor.SetupRay(ray, simpleRay.mOrigin, -simpleRay.mDirection); 62 ray.mFlags &= ~Ray::CULL_BACKFACES; 63 hitB.mObject = ray.intersections[0].mObject; 64 hitB.mPoint = ray.Extrap(ray.intersections[0].mT); 65 hitB.mNormal = ray.intersections[0].mNormal; 66 } 67 68 return ProcessRay( 69 simpleRay, 70 hitA, 71 hitB, 72 vssRays, 73 box, 74 castDoubleRay, 75 pruneInvalidRays 76 ); 77 } 78 79 80 int 81 InternalRayCaster::CastGlobalRay(const SimpleRay &simpleRay, 82 VssRayContainer &vssRays, 83 const AxisAlignedBox3 &box, 84 const bool pruneInvalidRays 85 ) 86 { 87 static Ray ray; 88 int hits = 0; 89 mPreprocessor.SetupRay(ray, simpleRay.mOrigin, simpleRay.mDirection); 90 91 float tmin, tmax; 92 if (!(box.ComputeMinMaxT(ray, &tmin, &tmax) && (tmin < tmax))) 93 return 0; 94 95 // shift the ray origin to tmin 96 // Vector3 origin = ray.Extrap(tmin); 97 // mPreprocessor.SetupRay(ray, origin, simpleRay.mDirection); 98 ray.SetType(Ray::GLOBAL_RAY); 99 ray.mFlags &= ~Ray::CULL_BACKFACES; 100 101 102 VssRay *vssRay; 103 104 if (mKdTree->CastRay(ray)) { 105 // sort intersections 106 ray.SortIntersections(); 107 //cout<<"I="<<ray.intersections.size()<<endl; 108 109 110 Ray::Intersection &hit = ray.intersections[0]; 111 112 if (DotProd(hit.mNormal, ray.GetDir()) < 0) { 113 // insert intial segment 114 vssRay = new VssRay( 115 ray.Extrap(tmin), 116 ray.Extrap(hit.mT), 117 NULL, 118 hit.mObject, 119 mPreprocessor.mPass, 120 simpleRay.mPdf 121 ); 122 vssRay->mFlags |= VssRay::Valid; 123 vssRays.push_back(vssRay); 124 ++hits; 125 } 126 127 hit = ray.intersections[ray.intersections.size()-1]; 128 if (DotProd(hit.mNormal, ray.GetDir()) > 0) { 129 130 // insert termination segment 131 vssRay = new VssRay( 132 ray.Extrap(tmax), 133 ray.Extrap(hit.mT), 134 NULL, 135 hit.mObject, 136 mPreprocessor.mPass, 137 simpleRay.mPdf 138 ); 139 vssRay->mFlags |= VssRay::Valid; 140 vssRays.push_back(vssRay); 141 ++hits; 142 } 143 144 // insert the rest of segments 145 for (int i=0; i < ray.intersections.size() - 1; i++) { 146 Ray::Intersection &hitA = ray.intersections[i]; 147 Ray::Intersection &hitB = ray.intersections[i + 1]; 148 if (DotProd(hitA.mNormal, ray.GetDir()) > 0 && 149 DotProd(hitB.mNormal, ray.GetDir()) < 0 150 ) { 151 152 vssRay = new VssRay( 153 ray.Extrap(hitA.mT), 154 ray.Extrap(hitB.mT), 155 hitA.mObject, 156 hitB.mObject, 157 mPreprocessor.mPass, 158 simpleRay.mPdf 159 ); 160 vssRay->mFlags |= VssRay::Valid; 161 vssRays.push_back(vssRay); 162 ++hits; 163 164 vssRay = new VssRay( 165 ray.Extrap(hitB.mT), 166 ray.Extrap(hitA.mT), 167 hitB.mObject, 168 hitA.mObject, 169 mPreprocessor.mPass, 170 simpleRay.mPdf 171 ); 172 173 vssRay->mFlags |= VssRay::Valid; 174 vssRays.push_back(vssRay); 175 ++hits; 176 } 177 } 63 178 } 64 65 return ProcessRay( 66 simpleRay, 67 hitA, 68 hitB, 69 vssRays, 70 box, 71 castDoubleRay, 72 pruneInvalidRays 73 ); 74 } 75 179 180 return hits; 181 } 76 182 77 183 void InternalRayCaster::CastRays16(const int index, 78 79 80 81 82 184 SimpleRayContainer &rays, 185 VssRayContainer &vssRays, 186 const AxisAlignedBox3 &sbox, 187 const bool castDoubleRays, 188 const bool pruneInvalidRays) 83 189 { 84 190 const int num = 16; -
GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.h
r1528 r1824 52 52 ); 53 53 54 virtual int 55 CastGlobalRay(const SimpleRay &simpleRay, 56 VssRayContainer &vssRays, 57 const AxisAlignedBox3 &box, 58 const bool pruneInvalidRays 59 ); 60 54 61 protected: 55 62 -
GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.cpp
r1786 r1824 23 23 if (ray.GetType() == Ray::LOCAL_RAY && !ray.intersections.empty()) 24 24 nearestT = ray.intersections[0].mT; 25 25 26 26 const int hitCode = mItem.CastRay(ray, t, nearestT, nearestNormal); 27 27 28 28 nearestT = t; 29 29 30 if ((hitCode == Ray::INTERSECTION) && (ray.GetType() == Ray::LOCAL_RAY)) 31 { 32 if (!ray.intersections.empty()) 33 { 34 ray.intersections[0] = Ray::Intersection(nearestT, nearestNormal, this, 0); 30 if (hitCode == Ray::INTERSECTION) { 31 if (ray.GetType() == Ray::LOCAL_RAY && !ray.intersections.empty()) { 32 ray.intersections[0] = Ray::Intersection(nearestT, 33 nearestNormal, 34 this, 35 0); 35 36 } 36 else 37 { 38 ray.intersections.push_back(Ray::Intersection(nearestT, nearestNormal, this, 0)); 37 else { 38 ray.intersections.push_back(Ray::Intersection(nearestT, 39 nearestNormal, 40 this, 41 0)); 39 42 } 40 43 41 44 return 1; 42 45 } 43 46 44 47 return 0; 45 48 } -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r1761 r1824 677 677 ObjectContainer::const_iterator mi; 678 678 for ( mi = leaf->mObjects.begin(); 679 mi != leaf->mObjects.end();680 mi++) {681 Intersectable *object = *mi;682 if (!object->Mailed() ) {683 684 685 ray.testedObjects.push_back(object);686 687 688 689 cout<<"Object "<<oi++;690 691 692 693 694 if (!ray.intersections.empty())695 cout<<"nearest t="<<ray.intersections[0].mT<<endl;696 697 cout<<"nearest t=-INF"<<endl;698 699 }679 mi != leaf->mObjects.end(); 680 mi++) { 681 Intersectable *object = *mi; 682 if (!object->Mailed() ) { 683 object->Mail(); 684 if (ray.mFlags & Ray::STORE_TESTED_OBJECTS) 685 ray.testedObjects.push_back(object); 686 687 static int oi=1; 688 if (MeshDebug) 689 cout<<"Object "<<oi++; 690 691 hits += object->CastRay(ray); 692 693 if (MeshDebug) { 694 if (!ray.intersections.empty()) 695 cout<<"nearest t="<<ray.intersections[0].mT<<endl; 696 else 697 cout<<"nearest t=-INF"<<endl; 698 } 699 } 700 700 } 701 701 702 702 if (hits && ray.GetType() == Ray::LOCAL_RAY) 703 if (ray.intersections[0].mT <= maxt)704 703 if (ray.intersections[0].mT <= maxt) 704 break; 705 705 706 706 // get the next node from the stack 707 707 if (tStack.empty()) 708 break;708 break; 709 709 710 710 entp = extp; 711 711 mint = maxt; 712 712 if (ray.GetType() == Ray::LINE_SEGMENT && mint > 1.0f) 713 break;713 break; 714 714 715 715 RayTraversalData &s = tStack.top(); -
GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
r1785 r1824 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1.2) on: ?t 23. XI 14:54:0720063 # Generated by qmake (2.00a) (Qt 4.1.2) on: út 28. XI 19:46:06 2006 4 4 # Project: preprocessor.pro 5 5 # Template: app -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp
r1772 r1824 219 219 faceIndex < mFaces.size(); 220 220 faceIndex++) { 221 hits += CastRayToFace(faceIndex, ray, nearestT, nearestNormal, nearestFace, instance); 221 hits += CastRayToFace(faceIndex, 222 ray, 223 nearestT, 224 nearestNormal, 225 nearestFace, 226 instance); 222 227 if (mIsConvex && nearestFace != -1) 223 228 break; … … 226 231 if ( hits && ray.GetType() == Ray::LOCAL_RAY ) { 227 232 if (ray.intersections.size()) 228 ray.intersections[0] = Ray::Intersection(nearestT, nearestNormal, instance, nearestFace); 233 ray.intersections[0] = Ray::Intersection(nearestT, 234 nearestNormal, 235 instance, 236 nearestFace); 229 237 else 230 ray.intersections.push_back(Ray::Intersection(nearestT, nearestNormal, instance, nearestFace)); 238 ray.intersections.push_back(Ray::Intersection(nearestT, 239 nearestNormal, 240 instance, 241 nearestFace)); 231 242 } 232 243 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1786 r1824 983 983 int 984 984 Preprocessor::GenerateRays(const int number, 985 986 985 const SamplingStrategy &strategy, 986 SimpleRayContainer &rays) 987 987 { 988 988 return strategy.GenerateSamples(number, rays); … … 991 991 int 992 992 Preprocessor::GenerateRays(const int number, 993 994 993 const int sampleType, 994 SimpleRayContainer &rays) 995 995 { 996 996 const int startSize = (int)rays.size(); … … 1037 1037 case SamplingStrategy::REVERSE_VIEWSPACE_BORDER_BASED_DISTRIBUTION: 1038 1038 return new ReverseViewSpaceBorderBasedDistribution(*this); 1039 //case OBJECTS_INTERIOR_DISTRIBUTION: 1040 // return new ObjectsInteriorDistribution(*this); 1039 case SamplingStrategy::GLOBAL_LINES_DISTRIBUTION: 1040 return new GlobalLinesDistribution(*this); 1041 1042 //case OBJECTS_INTERIOR_DISTRIBUTION: 1043 // return new ObjectsInteriorDistribution(*this); 1041 1044 default: // no valid strategy 1042 1045 Debug << "warning: no valid sampling strategy" << endl; -
GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer.cpp
r1785 r1824 148 148 149 149 if (viewcell) { 150 mViewCellsManager->ApplyFilter2(viewcell,151 false,152 1.0f,153 pvs);154 155 pvsSize = 0;156 SetupCamera();157 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);158 glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE);159 150 mViewCellsManager->ApplyFilter2(viewcell, 151 false, 152 1.0f, 153 pvs); 154 155 pvsSize = 0; 156 SetupCamera(); 157 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 158 glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE); 159 160 160 161 // // Render PVS162 ObjectPvsIterator it = pvs.GetIterator();163 164 pvsSize = pvs.GetSize();165 Intersectable::NewMail();161 // // Render PVS 162 ObjectPvsIterator it = pvs.GetIterator(); 163 164 pvsSize = pvs.GetSize(); 165 Intersectable::NewMail(); 166 166 for (; it.HasMoreEntries(); ) { 167 167 ObjectPvsEntry entry = it.Next(); … … 364 364 365 365 if (mUseSpatialFilter) { 366 // 9.11. 2006 -> experiment with new spatial filter366 // 9.11. 2006 -> experiment with new spatial filter 367 367 #if 0 368 mViewCellsManager->ApplySpatialFilter(mKdTree,369 370 371 368 mViewCellsManager->ApplySpatialFilter(mKdTree, 369 mSpatialFilterSize* 370 Magnitude(mViewCellsManager->GetViewSpaceBox().Size()), 371 pvs); 372 372 #else 373 // mSpatialFilter size is in range 0.001 - 0.1 374 mViewCellsManager->ApplyFilter2(viewcell, 375 mUseFilter, 376 100*mSpatialFilterSize, 377 pvs); 373 // mSpatialFilter size is in range 0.001 - 0.1 374 mViewCellsManager->ApplyFilter2(viewcell, 375 mUseFilter, 376 100*mSpatialFilterSize, 377 pvs, 378 &mPvsCache.filteredBoxes 379 ); 378 380 #endif 379 381 } else 380 pvs = viewcell->GetPvs();382 pvs = viewcell->GetPvs(); 381 383 } 382 384 383 385 // Render PVS 384 ObjectPvsIterator it = pvs.GetIterator(); 385 386 mPvsSize = pvs.GetSize(); 387 388 for (; it.HasMoreEntries(); ) { 389 ObjectPvsEntry entry = it.Next(); 390 Intersectable *object = entry.mObject; 391 392 if (mRenderVisibilityEstimates) { 386 if (mUseSpatialFilter && mRenderBoxes) { 387 for (int i=0; i < mPvsCache.filteredBoxes.size(); i++) 388 RenderBox(mPvsCache.filteredBoxes[i]); 389 } else { 390 ObjectPvsIterator it = pvs.GetIterator(); 393 391 394 float visibility = mTransferFunction*log10(entry.mData.mSumPdf + 1); // /5.0f 395 glColor3f(visibility, 0.0f, 0.0f); 396 mUseForcedColors = true; 397 RenderIntersectable(object); 398 mUseForcedColors = false; 399 } else { 400 mUseForcedColors = false; 401 RenderIntersectable(object); 402 } 392 mPvsSize = pvs.GetSize(); 393 for (; it.HasMoreEntries(); ) { 394 ObjectPvsEntry entry = it.Next(); 395 Intersectable *object = entry.mObject; 396 397 if (mRenderVisibilityEstimates) { 398 399 float visibility = mTransferFunction*log10(entry.mData.mSumPdf + 1); // /5.0f 400 glColor3f(visibility, 0.0f, 0.0f); 401 mUseForcedColors = true; 402 RenderIntersectable(object); 403 mUseForcedColors = false; 404 } else { 405 mUseForcedColors = false; 406 RenderIntersectable(object); 407 } 408 } 403 409 } 404 410 … … 412 418 glColor3f(1.0f, 0.0f, 0.0f); 413 419 gluSphere((::GLUquadric *)mSphere, 414 1e-3*Magnitude(mViewCellsManager->GetViewSpaceBox().Size()), 6, 6);420 1e-3*Magnitude(mViewCellsManager->GetViewSpaceBox().Size()), 6, 6); 415 421 glPopAttrib(); 416 422 glPopMatrix(); … … 422 428 423 429 } else { 424 ObjectContainer::const_iterator oi = mObjects.begin();425 for (; oi != mObjects.end(); oi++)426 430 ObjectContainer::const_iterator oi = mObjects.begin(); 431 for (; oi != mObjects.end(); oi++) 432 RenderIntersectable(*oi); 427 433 } 428 434 } -
GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer.h
r1785 r1824 116 116 117 117 118 struct PvsCache {119 PvsCache():mViewCell(NULL) {}120 void Reset() { mViewCell = NULL; mPvs.Clear(); }121 ViewCell *mViewCell;122 ObjectPvs mPvs;123 };124 125 118 class QtGlRendererWidget : public QGLWidget, public GlRendererWidget 126 119 { … … 156 149 float mManipulatorLastQuat[4]; 157 150 float mManipulatorScale; 158 PvsCache mPvsCache;159 151 160 152 QtRendererControlWidget *mControlWidget; -
GTP/trunk/Lib/Vis/Preprocessing/src/Ray.h
r1594 r1824 3 3 4 4 #include <vector> 5 #include <algorithm> 5 6 #include "Matrix4x4.h" 6 7 #include "Vector3.h" … … 46 47 Intersectable *mObject; 47 48 48 /// the face of the intersectable49 /// the face of the intersectable 49 50 int mFace; 50 51 51 52 Intersection(const float t, 52 53 54 55 53 const Vector3 &normal, 54 Intersectable *object, 55 const int face): 56 mT(t), mNormal(normal), mObject(object), mFace(face) 56 57 {} 57 58 58 59 Intersection(): mT(0), mNormal(0,0,0), mObject(NULL), mFace(0) 59 60 {} 60 61 61 62 bool operator<(const Intersection &b) const 62 63 { … … 113 114 void Init(const VssRay &vssRay); 114 115 116 void SortIntersections() { 117 sort(intersections.begin(), intersections.end()); 118 } 119 115 120 Intersectable *GetIntersectionObject(const int i) const { 116 121 return intersections[i].mObject; … … 215 220 216 221 int GetType() const { return mType; } 222 void SetType(const int t) { mType = t; } 217 223 218 224 // make such operation to slightly change the ray direction … … 313 319 Vector3 mDirection; 314 320 float mPdf; 315 316 SimpleRay() {} 321 int mType; 322 323 SimpleRay(): mType(Ray::LOCAL_RAY) {} 317 324 SimpleRay(const Vector3 &o, const Vector3 &d, const float p=1.0f): 318 mOrigin(o), mDirection(d), mPdf(p) {}319 325 mOrigin(o), mDirection(d), mPdf(p), mType(Ray::LOCAL_RAY) {} 326 320 327 Vector3 Extrap(const float t) const { 321 328 return mOrigin + mDirection * t; -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp
r1771 r1824 150 150 { 151 151 VssRay *vssRay = new VssRay( 152 153 154 155 156 157 158 152 hitA.mPoint, 153 hitB.mPoint, 154 hitA.mObject, 155 hitB.mObject, 156 mPreprocessor.mPass, 157 simpleRay.mPdf 158 ); 159 159 if (validB) 160 vssRay->mFlags |= VssRay::Valid;160 vssRay->mFlags |= VssRay::Valid; 161 161 162 162 vssRays.push_back(vssRay); -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
r1545 r1824 74 74 75 75 Intersection(const Vector3 &p, const Vector3 &n, Intersectable *o, const int f): 76 mPoint(p), mNormal(n), mObject(o), mFaceId(f)76 mPoint(p), mNormal(n), mObject(o), mFaceId(f) 77 77 {} 78 78 … … 84 84 int mFaceId; 85 85 }; 86 86 87 87 88 int ProcessRay( -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
r1785 r1824 73 73 case SamplingStrategy::RSS_BASED_DISTRIBUTION: 74 74 case SamplingStrategy::RSS_SILHOUETTE_BASED_DISTRIBUTION: 75 if (mRssTree) {76 77 }78 break;79 75 if (mRssTree) { 76 result = GenerateImportanceRays(mRssTree, number, rays); 77 } 78 break; 79 80 80 default: 81 result = Preprocessor::GenerateRays(number, sampleType, rays);81 result = Preprocessor::GenerateRays(number, sampleType, rays); 82 82 } 83 83 … … 465 465 466 466 if (mUseRssTree) 467 mDistributions.push_back(new RssBasedDistribution(*this)); 468 469 // mDistributions.push_back(new SpatialBoxBasedDistribution(*this)); 470 // mDistributions.push_back(new DirectionBasedDistribution(*this)); 471 mDistributions.push_back(new ObjectDirectionBasedDistribution(*this)); 472 // mDistributions.push_back(new ReverseObjectBasedDistribution(*this)); 473 mDistributions.push_back(new ObjectBasedDistribution(*this)); 474 mDistributions.push_back(new ReverseViewSpaceBorderBasedDistribution(*this)); 467 mDistributions.push_back(new RssBasedDistribution(*this)); 468 469 470 if (1) { 471 // mDistributions.push_back(new SpatialBoxBasedDistribution(*this)); 472 // mDistributions.push_back(new DirectionBasedDistribution(*this)); 473 mDistributions.push_back(new ObjectDirectionBasedDistribution(*this)); 474 // mDistributions.push_back(new ReverseObjectBasedDistribution(*this)); 475 mDistributions.push_back(new ObjectBasedDistribution(*this)); 476 mDistributions.push_back(new ReverseViewSpaceBorderBasedDistribution(*this)); 477 } else { 478 mDistributions.push_back(new GlobalLinesDistribution(*this)); 479 } 475 480 476 481 if (mLoadInitialSamples) { … … 495 500 if (mDistributions[i]->mType != SamplingStrategy::RSS_BASED_DISTRIBUTION) 496 501 GenerateRays(mInitialSamples/count, 497 mDistributions[i]->mType, rays); 502 mDistributions[i]->mType, 503 rays); 498 504 499 505 } else { … … 582 588 583 589 rssPass++; 584 590 591 // mDistributions.resize(1); 592 585 593 mRssTree = new RssTree; 586 594 mRssTree->SetPass(mPass); -
GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
r1785 r1824 336 336 leaf->dirBBox.Initialize(); 337 337 leaf->dirBBox.SetMin(2, 0.0f); 338 leaf->dirBBox.SetMax(2, 1.0f);338 leaf->dirBBox.SetMax(2, 0.0f); 339 339 mRoots[i] = leaf; 340 340 } … … 391 391 // make the z axis (unused) a unit size 392 392 // important for volume computation 393 394 393 395 394 // if ( forcedBoundingBox ) … … 2230 2229 dirVector = dirBox.GetPoint(dVector); 2231 2230 2232 direction = Vector3(sin(dirVector.x), sin(dirVector.y), cos(dirVector.x)); 2233 2234 2235 // shift the origin a little bit 2236 direction.Normalize(); 2231 direction = VssRay::GetInvDirParam(dirVector.x, dirVector.y); 2237 2232 2238 2233 // float dist = Min(avgLength*0.5f, Magnitude(GetBBox(leaf).Size())); … … 2243 2238 #if 1 2244 2239 if (box.ComputeMinMaxT(origin, direction, &minT, &maxT) && minT < maxT) 2245 dist = maxT;2240 dist = (maxT + 1e-2*boxSize); 2246 2241 #else 2247 2242 dist = 0.5f*boxSize; … … 2373 2368 w1*leaf->rays[r1].GetDir() + 2374 2369 w2*leaf->rays[r2].GetDir(); 2370 2371 // shift the origin a little bit 2372 direction.Normalize(); 2373 2375 2374 } else { 2376 2375 Vector3 dirVector; … … 2405 2404 dirVector = dirBox.GetPoint(dVector); 2406 2405 2407 direction = Vector3(sin(dirVector.x), sin(dirVector.y), cos(dirVector.x)); 2408 } 2409 2410 // shift the origin a little bit 2411 direction.Normalize(); 2406 direction = VssRay::GetInvDirParam(dirVector.x,dirVector.y); 2407 } 2408 2412 2409 2413 2410 // float dist = Min(avgLength*0.5f, Magnitude(GetBBox(leaf).Size())); … … 2628 2625 if (node->IsLeaf()) { 2629 2626 RssTreeLeaf *leaf = (RssTreeLeaf *)node; 2630 // 2627 // prunned += PruneRaysRandom(leaf, ratio); 2631 2628 prunned += PruneRaysContribution(leaf, ratio); 2632 2629 } else { … … 2759 2756 // if small very high importance of the last sample 2760 2757 // if 1.0f then weighs = 1 1/2 1/3 1/4 2758 //float passSampleWeightDecay = 1.0f; 2761 2759 float passSampleWeightDecay = 1.0f; 2762 //float passSampleWeightDecay = 0.0001f;2763 2760 2764 2761 float … … 2768 2765 float weight; 2769 2766 if (1) 2770 weight = 1.0f/sqr(passDiff + passSampleWeightDecay);2767 weight = 1.0f/(passDiff + passSampleWeightDecay); 2771 2768 else 2772 switch (passDiff) {2769 switch (passDiff) { 2773 2770 case 0: 2774 2775 2776 default:2777 2778 2771 // weight = 1.0f; 2772 // break; 2773 default: 2774 weight = 1.0f; 2775 break; 2779 2776 // case 1: 2780 2777 // weight = 0.5f; … … 2823 2820 float sumRelContributions = 0.0f; 2824 2821 float sumWeights = 0.0f; 2822 float maxContribution = 0.0f; 2823 float maxRelContribution = 0.0f; 2824 float sumLength = 0; 2825 2825 2826 for (; it != it_end; ++it) { 2826 2827 VssRay *ray = (*it).mRay; 2828 float sumLength = ray->Length(); 2829 2827 2830 float weight = GetSampleWeight(ray->mPass); 2828 2831 2829 sumContributions += weight*ray->mPvsContribution; 2830 //$$ 20.7. changed to sqr to pronouce higher contribution so that they do not get smoothed!! 2832 float c1 = weight*ray->mPvsContribution; 2833 float c2 = weight*ray->mRelativePvsContribution; 2834 sumContributions += c1; 2835 if (c1 > maxContribution) 2836 maxContribution = c1; 2837 2838 //$$ 20.7. changed to sqr to pronouce higher contribution so that 2839 // they do not get smoothed!! 2831 2840 //sumRelContributions += weight*ray->mRelativePvsContribution; 2832 2833 sumRelContributions += sqr(weight*ray->mRelativePvsContribution); 2834 2841 2842 sumRelContributions += c2; 2843 if (c2 > maxRelContribution) 2844 maxRelContribution = c2; 2845 2835 2846 //sumWeights += weight; 2836 2847 sumWeights += 1.0f; 2837 2848 } 2849 2850 float distImportance = 0.0f; 2851 2852 if (leaf->rays.size()) { 2853 // compute average length of the ray 2854 float avgLength = sumLength/leaf->rays.size(); 2855 // compute estimated area of the visible surface corresponding to these rays 2856 float ss = GetBBox(leaf).SurfaceArea()/2.0f; 2857 float sd = GetDirBBox(leaf).SurfaceArea(); 2858 float s = ss + avgLength*(2*sqrt(ss*sd) + avgLength*sd); 2859 2860 distImportance = s/leaf->rays.size(); 2861 } 2862 2838 2863 // $$ 2839 2864 // sumWeights = leaf->mTotalRays; 2840 2841 if (sumWeights != 0.0f) 2865 2866 if (sumWeights != 0.0f) { 2842 2867 leaf->mImportance = 2843 (weightAbsContributions*sumContributions + 2844 (1.0f - weightAbsContributions)*sumRelContributions)/sumWeights; 2845 else 2868 sqr(((weightAbsContributions*sumContributions + 2869 (1.0f - weightAbsContributions)*sumRelContributions)/sumWeights)); 2870 2871 // leaf->mImportance = 2872 // (weightAbsContributions*maxContribution + 2873 // (1.0f - weightAbsContributions)*maxRelContribution)/sumWeights; 2874 2875 } else 2846 2876 leaf->mImportance = 0.0f; 2847 2877 … … 2856 2886 RssTreeLeaf::GetImportance() const 2857 2887 { 2858 // return sqr(mImportance);2888 // return sqr(mImportance); 2859 2889 return mImportance; 2860 2890 } -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r1785 r1824 386 386 } 387 387 388 } 389 390 388 389 bool 390 GlobalLinesDistribution::GenerateSample(SimpleRay &ray) const 391 { 392 Vector3 origin, termination, direction; 393 394 origin = mPreprocessor.mViewCellsManager->GetViewSpaceBox().GetRandomSurfacePoint(); 395 396 termination = mPreprocessor.mViewCellsManager->GetViewSpaceBox().GetRandomSurfacePoint(); 397 398 direction = termination - origin; 399 //direction = UniformRandomVector(); 400 401 402 // $$ jb the pdf is yet not correct for all sampling methods! 403 const float c = Magnitude(direction); 404 if (c <= Limits::Small) 405 return false; 406 407 408 direction *= 1.0f / c; 409 410 // a little offset 411 // origin += direction * 0.001f; 412 413 // $$ jb the pdf is yet not correct for all sampling methods! 414 const float pdf = 1.0f; 415 416 ray = SimpleRay(origin, direction, pdf); 417 ray.mType = Ray::GLOBAL_RAY; 418 return true; 419 } 420 421 } 422 423 -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h
r1772 r1824 32 32 VIEWCELL_BORDER_BASED_DISTRIBUTION, 33 33 VIEWSPACE_BORDER_BASED_DISTRIBUTION, 34 REVERSE_VIEWSPACE_BORDER_BASED_DISTRIBUTION 34 REVERSE_VIEWSPACE_BORDER_BASED_DISTRIBUTION, 35 GLOBAL_LINES_DISTRIBUTION 35 36 }; 36 37 … … 199 200 }; 200 201 202 class GlobalLinesDistribution: public SamplingStrategy 203 { 204 public: 205 GlobalLinesDistribution(const Preprocessor &preprocessor): 206 SamplingStrategy(preprocessor) { 207 mType = GLOBAL_LINES_DISTRIBUTION; 208 } 209 210 virtual bool GenerateSample(SimpleRay &ray) const; 211 }; 212 201 213 202 214 /** This strategy generates samples inside of the objects, e.g., -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1816 r1824 32 32 33 33 // $$JB HACK 34 #define USE_KD_PVS 034 #define USE_KD_PVS 1 35 35 #define KD_PVS_AREA (1e-5f) 36 36 … … 856 856 viewCells = mViewCells; 857 857 #endif 858 ViewCellContainer::iterator it = viewCells.begin(), it_end = viewCells.end(); 858 ViewCellContainer::iterator it = viewCells.begin(), 859 it_end = viewCells.end(); 859 860 for (; it != it_end; ++it) { 860 861 //(*it)->UpdatePvsCost(); … … 872 873 // hack: normalize pvs size 873 874 int histoMaxVal; 874 Environment::GetSingleton()->GetIntValue("Preprocessor.histogram.maxValue", histoMaxVal); 875 Environment::GetSingleton()->GetIntValue( 876 "Preprocessor.histogram.maxValue", histoMaxVal); 875 877 maxVal = max((float)histoMaxVal, maxPvs); 876 878 … … 1831 1833 if (evaluateFilter) { 1832 1834 ObjectPvs filteredPvs = viewcell->GetPvs(); 1833 PvsFilterStatistics fstat = ApplyFilter2(viewcell, false, 1834 1.0f, filteredPvs); 1835 PvsFilterStatistics fstat = ApplyFilter2(viewcell, 1836 false, 1837 2.0f, 1838 filteredPvs); 1835 1839 1836 1840 float filteredCost = filteredPvs.EvalPvsCost(); … … 1970 1974 1971 1975 float ViewCellsManager::ComputeSampleContribution(VssRay &ray, 1972 1973 1976 const bool addRays, 1977 const bool storeViewCells) 1974 1978 { 1975 1979 ViewCellContainer viewcells; … … 2026 2030 ++ ray.mPvsContribution; 2027 2031 ray.mRelativePvsContribution += contribution; 2032 // $$ test of different contribution measure 2033 // ray.mRelativePvsContribution += 1.0f/(viewcell->GetPvs().GetSize() + 10.0f); 2034 2028 2035 } 2029 2036 } … … 2037 2044 if (ray.mOriginObject && 2038 2045 viewcell->GetPvs().GetSampleContribution(ray.mOriginObject, 2039 ray.mPdf,2040 contribution))2041 {2042 ++ ray.mPvsContribution;2043 ray.mRelativePvsContribution += contribution;2044 }2046 ray.mPdf, 2047 contribution)) 2048 { 2049 ++ ray.mPvsContribution; 2050 ray.mRelativePvsContribution += contribution; 2051 } 2045 2052 #endif 2046 2053 } … … 2582 2589 PvsFilterStatistics 2583 2590 ViewCellsManager::ApplyFilter2(ViewCell *viewCell, 2584 const bool useViewSpaceFilter, 2585 const float filterSize, 2586 ObjectPvs &pvs 2587 ) 2588 { 2589 cout<<"y"; 2591 const bool useViewSpaceFilter, 2592 const float filterSize, 2593 ObjectPvs &pvs, 2594 vector<AxisAlignedBox3> *filteredBoxes 2595 ) 2596 { 2597 //cout<<"y"; 2590 2598 PvsFilterStatistics stats; 2591 2599 … … 2601 2609 // first mark all object from this pvs 2602 2610 while (pit.HasMoreEntries()) { 2603 ObjectPvsEntry entry = pit.Next();2604 2605 Intersectable *object = entry.mObject;2606 object->Mail();2611 ObjectPvsEntry entry = pit.Next(); 2612 2613 Intersectable *object = entry.mObject; 2614 object->Mail(); 2607 2615 } 2608 2616 #endif … … 2625 2633 // and gobal estimate for the view cell 2626 2634 // (total #rays intersecting the viewcell) 2627 #define MIN_LOCAL_SAMPLES 5 2628 2635 int minLocalSamples = 2; 2636 2629 2637 float viewCellRadius = 0.5f*Magnitude(vbox.Diagonal()); 2630 2638 … … 2632 2640 2633 2641 if (useViewSpaceFilter) { 2634 // float radius = Max(viewCellRadius/100.0f, avgRadius - viewCellRadius);2635 float radius = viewCellRadius/100.0f;2636 vbox.Enlarge(radius);2637 cout<<"vbox = "<<vbox<<endl;2638 ViewCellContainer viewCells;2639 ComputeBoxIntersections(vbox, viewCells);2640 2641 ViewCellContainer::const_iterator it = viewCells.begin(),2642 2643 int i = 0;2644 for (i=0; it != it_end; ++ it, ++ i)2645 2646 //cout<<"v"<<i<<" pvs="<<(*it)->GetPvs().mEntries.size()<<endl;2647 basePvs.MergeInPlace((*it)->GetPvs());2648 2649 2650 // update samples and globalC2651 samples = (float)pvs.GetSamples();2652 // cout<<"neighboring viewcells = "<<i-1<<endl;2653 // cout<<"Samples' = "<<samples<<endl;2642 // float radius = Max(viewCellRadius/100.0f, avgRadius - viewCellRadius); 2643 float radius = viewCellRadius/100.0f; 2644 vbox.Enlarge(radius); 2645 cout<<"vbox = "<<vbox<<endl; 2646 ViewCellContainer viewCells; 2647 ComputeBoxIntersections(vbox, viewCells); 2648 2649 ViewCellContainer::const_iterator it = viewCells.begin(), 2650 it_end = viewCells.end(); 2651 int i = 0; 2652 for (i=0; it != it_end; ++ it, ++ i) 2653 if ((*it) != viewCell) { 2654 //cout<<"v"<<i<<" pvs="<<(*it)->GetPvs().mEntries.size()<<endl; 2655 basePvs.MergeInPlace((*it)->GetPvs()); 2656 } 2657 2658 // update samples and globalC 2659 samples = (float)pvs.GetSamples(); 2660 // cout<<"neighboring viewcells = "<<i-1<<endl; 2661 // cout<<"Samples' = "<<samples<<endl; 2654 2662 } 2655 2663 2656 2664 // Minimal number of samples so that filtering takes place 2657 #define MIN_SAMPLES 100 2665 #define MIN_SAMPLES 50 2666 2658 2667 if (samples > MIN_SAMPLES) { 2659 float globalC = 2.0f*filterSize/sqrt(samples); 2660 2661 pit = basePvs.GetIterator(); 2662 2663 ObjectContainer objects; 2664 2665 while (pit.HasMoreEntries()) 2666 { 2667 ObjectPvsEntry entry = pit.Next(); 2668 2669 Intersectable *object = entry.mObject; 2670 // compute filter size based on the distance and the numebr of samples 2671 AxisAlignedBox3 box = object->GetBox(); 2672 2673 float distance = Distance(center, box.Center()); 2674 float globalRadius = distance*globalC; 2675 2676 int objectSamples = (int)entry.mData.mSumPdf; 2677 float localRadius = MAX_FLOAT; 2678 if (objectSamples > MIN_LOCAL_SAMPLES) 2679 localRadius = filterSize*0.5f*Magnitude(box.Diagonal())/ 2680 sqrt((float)objectSamples); 2681 2682 // cout<<"lr="<<localRadius<<" gr="<<globalRadius<<endl; 2683 2684 // now compute the filter size 2685 float radius; 2686 2687 if (localRadius < globalRadius) { 2688 radius = localRadius; 2689 stats.mLocalFilterCount++; 2690 } else { 2691 radius = globalRadius; 2692 stats.mGlobalFilterCount++; 2693 } 2694 2695 stats.mAvgFilterRadius += radius; 2696 2697 // cout<<"box = "<<box<<endl; 2698 // cout<<"distance = "<<distance<<endl; 2699 // cout<<"radiues = "<<radius<<endl; 2700 2701 box.Enlarge(Vector3(radius)); 2702 2703 objects.clear(); 2704 // $$ warning collect objects takes only unmailed ones! 2705 CollectObjects(box, objects); 2706 // cout<<"collected objects="<<objects.size()<<endl; 2707 ObjectContainer::const_iterator noi = objects.begin(); 2708 for (; noi != objects.end(); ++ noi) { 2709 Intersectable *o = *noi; 2710 // $$ JB warning: pdfs are not correct at this point! 2711 pvs.AddSampleDirty(o, Limits::Small); 2712 } 2713 } 2714 stats.mAvgFilterRadius /= (stats.mLocalFilterCount + stats.mGlobalFilterCount); 2668 float globalC = 2.0f*filterSize/sqrt(samples); 2669 2670 pit = basePvs.GetIterator(); 2671 2672 ObjectContainer objects; 2673 2674 while (pit.HasMoreEntries()) 2675 { 2676 ObjectPvsEntry entry = pit.Next(); 2677 2678 Intersectable *object = entry.mObject; 2679 // compute filter size based on the distance and the numebr of samples 2680 AxisAlignedBox3 box = object->GetBox(); 2681 2682 float distance = Distance(center, box.Center()); 2683 float globalRadius = distance*globalC; 2684 2685 int objectSamples = (int)entry.mData.mSumPdf; 2686 float localRadius = MAX_FLOAT; 2687 2688 localRadius = filterSize*0.5f*Magnitude(box.Diagonal())/ 2689 sqrt((float)objectSamples); 2690 2691 // cout<<"lr="<<localRadius<<" gr="<<globalRadius<<endl; 2692 2693 // now compute the filter size 2694 float radius; 2695 2696 #if 0 2697 if (objectSamples <= 1) { 2698 if (localRadius > globalRadius) { 2699 radius = 0.5flRadius; 2700 stats.mLocalFilterCount++; 2701 } else { 2702 radius = globalRadius; 2703 stats.mGlobalFilterCount++; 2704 } 2705 } else { 2706 radius = localRadius; 2707 stats.mLocalFilterCount++; 2708 } 2709 #else 2710 radius = 0.5f*globalRadius + 0.5f*localRadius; 2711 stats.mLocalFilterCount++; 2712 stats.mGlobalFilterCount++; 2713 #endif 2714 2715 stats.mAvgFilterRadius += radius; 2716 2717 // cout<<"box = "<<box<<endl; 2718 // cout<<"distance = "<<distance<<endl; 2719 // cout<<"radiues = "<<radius<<endl; 2720 2721 box.Enlarge(Vector3(radius)); 2722 if (filteredBoxes) 2723 filteredBoxes->push_back(box); 2724 objects.clear(); 2725 // $$ warning collect objects takes only unmailed ones! 2726 CollectObjects(box, objects); 2727 // cout<<"collected objects="<<objects.size()<<endl; 2728 ObjectContainer::const_iterator noi = objects.begin(); 2729 for (; noi != objects.end(); ++ noi) { 2730 Intersectable *o = *noi; 2731 // $$ JB warning: pdfs are not correct at this point! 2732 pvs.AddSampleDirty(o, Limits::Small); 2733 } 2734 } 2735 stats.mAvgFilterRadius /= (stats.mLocalFilterCount + stats.mGlobalFilterCount); 2715 2736 } 2716 2737 … … 2721 2742 pit = basePvs.GetIterator(); 2722 2743 while (pit.HasMoreEntries()) { 2723 ObjectPvsEntry entry = pit.Next();2724 pvs.AddSampleDirty(entry.mObject, entry.mData.mSumPdf);2744 ObjectPvsEntry entry = pit.Next(); 2745 pvs.AddSampleDirty(entry.mObject, entry.mData.mSumPdf); 2725 2746 } 2726 2747 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r1789 r1824 500 500 PvsFilterStatistics 501 501 ApplyFilter2(ViewCell *viewCell, 502 const bool useViewSpaceFilter, 503 const float filterSize, 504 ObjectPvs &pvs 505 ); 502 const bool useViewSpaceFilter, 503 const float filterSize, 504 ObjectPvs &pvs, 505 vector<AxisAlignedBox3> *filteredBoxes = NULL 506 ); 506 507 507 508 void ApplySpatialFilter(KdTree *kdTree, -
GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.cpp
r1580 r1824 8 8 VssRay::mailID = 0; 9 9 10 #define OLD_PARAM 0 10 11 11 12 VssRay::VssRay( … … 230 231 VssRay::GetDirParam(const int axis, const Vector3 dir) 231 232 { 233 Vector3 d = Normalize(dir); 234 #if OLD_PARAM 232 235 return (axis == 0) ? atan2(dir.x, dir.z) : asin(dir.y); 236 #else 237 // x = cos(p0)sin(p1) 238 // y = cos(p1) 239 // z = sin(p0)sin(p1) 240 return (axis == 0) ? atan2(dir.z, dir.x) : acos(dir.y); 241 #endif 242 } 243 244 Vector3 VssRay::GetInvDirParam(const float alpha, const float beta) 245 { 246 #if OLD_PARAM 247 return Normalize(Vector3(sin(alpha), sin(beta), cos(alpha))); 248 249 #else 250 return Normalize(Vector3(cos(alpha)*sin(beta), 251 cos(beta), 252 sin(alpha)*sin(beta))); 253 #endif 233 254 } 234 255 -
GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.h
r1785 r1824 14 14 class KdNode; 15 15 16 #define ABS_CONTRIBUTION_WEIGHT 0. 8f16 #define ABS_CONTRIBUTION_WEIGHT 0.5f 17 17 18 18 class VssRay { … … 137 137 138 138 static float VssRay::GetDirParam(const int axis, const Vector3 dir); 139 static Vector3 VssRay::GetInvDirParam(const float alpha, const float beta); 139 140 140 141 float GetSize() const { return 1.0f/mInvSize; } … … 203 204 static Vector3 204 205 GetDirection(const float a, const float b) { 205 return Vector3(sin(a), sin(b), cos(a)); 206 return GetInvDirParam(a, b); 207 //return Vector3(sin(a), sin(b), cos(a)); 206 208 } 207 209 -
GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.cpp
r1359 r1824 1751 1751 origin = GetBBox(leaf).GetRandomPoint(); 1752 1752 Vector3 dirVector = GetDirBBox(leaf).GetRandomPoint(); 1753 direction = V ector3(sin(dirVector.x), sin(dirVector.y), cos(dirVector.x));1753 direction = VssRay::GetInvDirParam(dirVector.x,dirVector.y); 1754 1754 } 1755 1755 //cout<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; -
GTP/trunk/Lib/Vis/Preprocessing/src/default.env
r1785 r1824 7 7 8 8 #filename ../data/Arena/arena-low-lods.obj 9 9 #filename ../data/Arena/arena-high-lods.obj 10 10 # filename ../data/City4M/City4M.obj 11 11 # filename ../data/CityModel/CityModel.obj … … 84 84 85 85 SamplingPreprocessor { 86 totalSamples 5000000086 totalSamples 100000000 87 87 samplesPerPass 5000000 88 88 } … … 91 91 samplesPerPass 1000 92 92 initialSamples 3000000 93 vssSamples 5000000093 vssSamples 100000000 94 94 vssSamplesPerPass 5000000 95 95 useImportanceSampling true … … 101 101 pvs false 102 102 rssTree false 103 rays false104 numRays 2000103 rays true 104 numRays 10000 105 105 } 106 106 … … 110 110 storeInitialSamples false 111 111 112 useRssTree false112 useRssTree true 113 113 } 114 114 … … 124 124 # splitType heuristic 125 125 126 minRays 100126 minRays 200 127 127 minSize 0.001 128 128 maxCostRatio 1.0 129 129 maxRayContribution 1.0 130 maxRays 3000000131 maxTotalMemory 200132 maxStaticMemory 100130 maxRays 10000000 131 maxTotalMemory 400 132 maxStaticMemory 200 133 133 134 134 # splitType regular … … 206 206 #type vspKdTree 207 207 #type bspTree 208 #type vspBspTree209 type vspOspTree208 type vspBspTree 209 #type vspOspTree 210 210 #type sceneDependent 211 211 … … 264 264 265 265 # filename ../data/Arena/viewcells-5000.xml 266 #filename ../data/Arena/viewcells-20000.xml266 filename ../data/Arena/viewcells-20000.xml 267 267 268 268 # filename ../data/atlanta/atlanta_viewcells_large.x3d … … 278 278 # filename ../data/test1/test-viewcells.xml 279 279 280 # filename ../data/soda/soda5-viewcell-single.xm 281 # filename ../data/soda/soda-viewcells-1000.xml.zip 282 # filename ../data/soda/soda-viewcells-vsposp.xml 280 # filename ../data/soda/soda-viewcells-1000.xml.gz 283 281 284 282 -
GTP/trunk/Lib/Vis/Preprocessing/src/run_test2
r1785 r1824 29 29 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 30 30 31 PREFIX=../work/plots/osp-rss-1e5 -n31 PREFIX=../work/plots/osp-rss-1e5 32 32 33 33 #SCENE=../data/atlanta/atlanta2.x3d … … 42 42 $COMMAND -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 43 43 -rss_use_importance+ -rss_update_subdivision+ -rss_split=hybrid -hybrid_depth=10 \ 44 -view_cells_filter_max_size=1 -preprocessor_stats=$PREFIX-i-combined-update-ccb12 .log \45 -preprocessor_histogram_file=$PREFIX-i-combined-update-ccb12 .hlog44 -view_cells_filter_max_size=1 -preprocessor_stats=$PREFIX-i-combined-update-ccb12-n.log \ 45 -preprocessor_histogram_file=$PREFIX-i-combined-update-ccb12-n.hlog 46 46 47 47 … … 60 60 61 61 62 $COMMAND -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \63 -rss_use_importance+ -rss_use_rss_tree- -view_cells_filter_max_size=1 \64 -preprocessor_stats=$PREFIX-i-mixed-b1.log \65 -preprocessor_histogram_file=$PREFIX-i-mixed-b1.hlog62 # $COMMAND -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 63 # -rss_use_importance+ -rss_use_rss_tree- -view_cells_filter_max_size=1 \ 64 # -preprocessor_stats=$PREFIX-i-mixed-b1.log \ 65 # -preprocessor_histogram_file=$PREFIX-i-mixed-b1.hlog 66 66 67 68 # $COMMAND -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 69 # -rss_use_importance+ -rss_use_rss_tree- -view_cells_filter_max_size=1 \ 70 # -rss_initial_samples=500000 -rss_vss_samples_per_pass=500000 -preprocessor_ray_cast_method=0 \ 71 # -preprocessor_stats=$PREFIX-i-global-b1.log \ 72 # -preprocessor_histogram_file=$PREFIX-i-global-b1.hlog 73
Note: See TracChangeset
for help on using the changeset viewer.