- Timestamp:
- 12/12/06 17:25:53 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r1696 r1883 196 196 cout << "s"; 197 197 const Vector3 p = (p1 + p2) * 0.5f; 198 SimpleRay sray(oldRay.mOrigin, p - oldRay.mOrigin );198 SimpleRay sray(oldRay.mOrigin, p - oldRay.mOrigin, SamplingStrategy::GVS, 1.0f); 199 199 200 200 // cast ray into the new subdivision point … … 250 250 { 251 251 const Vector3 rayDir = (*vit) - currentRay.GetOrigin(); 252 SimpleRay sr(currentRay.GetOrigin(), rayDir );252 SimpleRay sr(currentRay.GetOrigin(), rayDir, SamplingStrategy::GVS, 1.0f); 253 253 simpleRays.AddRay(sr); 254 254 } -
GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.cpp
r1876 r1883 125 125 126 126 vssRay->mFlags |= VssRay::Valid; 127 vssRay->mDistribution = simpleRay.mDistribution; 127 128 vssRays.push_back(vssRay); 128 129 ++hits; … … 143 144 ); 144 145 vssRay->mFlags |= VssRay::Valid; 146 vssRay->mDistribution = simpleRay.mDistribution; 145 147 vssRays.push_back(vssRay); 146 148 ++hits; … … 165 167 ); 166 168 vssRay->mFlags |= VssRay::Valid; 169 vssRay->mDistribution = simpleRay.mDistribution; 167 170 vssRays.push_back(vssRay); 168 171 ++hits; … … 178 181 179 182 vssRay->mFlags |= VssRay::Valid; 183 vssRay->mDistribution = simpleRay.mDistribution; 180 184 vssRays.push_back(vssRay); 181 185 ++hits; -
GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
r1877 r1883 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1.2) on: ne 10. XII 21:55:0720063 # Generated by qmake (2.00a) (Qt 4.1.2) on: po 11. XII 10:42:23 2006 4 4 # Project: preprocessor.pro 5 5 # Template: app … … 63 63 $(MAKE) -f $(MAKEFILE).Debug uninstall 64 64 65 Makefile: preprocessor.pro C:/Qt/4.1.2/mkspecs/win32-msvc .net\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \65 Makefile: preprocessor.pro C:/Qt/4.1.2/mkspecs/win32-msvc2005\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \ 66 66 C:\Qt\4.1.2\mkspecs\features\qt_config.prf \ 67 67 C:\Qt\4.1.2\mkspecs\features\exclusive_builds.prf \ -
GTP/trunk/Lib/Vis/Preprocessing/src/Plane3.cpp
r1524 r1883 97 97 98 98 Normalize(dir); 99 return SimpleRay(point, dir );99 return SimpleRay(point, dir, 0, 1.0f); 100 100 } 101 101 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1867 r1883 1193 1193 //const Vector3 newOrigin = mainRay.mOrigin; 1194 1194 1195 rayBundle.push_back(SimpleRay(newOrigin, newDir, 0 ));1195 rayBundle.push_back(SimpleRay(newOrigin, newDir, 0, 1.0f)); 1196 1196 } 1197 1197 -
GTP/trunk/Lib/Vis/Preprocessing/src/Ray.cpp
r1867 r1883 18 18 19 19 20 int21 SimpleRay::sSimpleRayId = 1;22 20 23 21 -
GTP/trunk/Lib/Vis/Preprocessing/src/Ray.h
r1877 r1883 316 316 struct SimpleRay 317 317 { 318 int mId;319 318 Vector3 mOrigin; 320 319 Vector3 mDirection; 320 short mType; 321 short mDistribution; 321 322 float mPdf; 322 int mType; 323 324 static int sSimpleRayId; 323 325 324 SimpleRay(): mType(Ray::LOCAL_RAY) { 325 } 326 327 SimpleRay(const Vector3 &o, 328 const Vector3 &d, 329 const short distribution, 330 const float weight 331 ): 332 mOrigin(o), 333 mDirection(d), 334 mType(Ray::LOCAL_RAY), 335 mDistribution(distribution), 336 mPdf(weight) 337 { 326 338 // mId = sSimpleRayId++; 327 339 } 328 340 329 SimpleRay(const Vector3 &o, const Vector3 &d, const float p=1.0f):330 mOrigin(o), mDirection(d), mPdf(p), mType(Ray::LOCAL_RAY) {331 // mId = sSimpleRayId++;332 }333 334 341 Vector3 Extrap(const float t) const { 335 342 return mOrigin + mDirection * t; -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp
r1867 r1883 146 146 if (validA) 147 147 vssRay->mFlags |= VssRay::Valid; 148 vssRay->m GeneratingRayId = simpleRay.mId;148 vssRay->mDistribution = simpleRay.mDistribution; 149 149 vssRays.push_back(vssRay); 150 150 ++ hits; … … 169 169 vssRay->mFlags |= VssRay::Valid; 170 170 171 vssRay->m GeneratingRayId = simpleRay.mId;171 vssRay->mDistribution = simpleRay.mDistribution; 172 172 vssRays.push_back(vssRay); 173 173 ++ hits; -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
r1877 r1883 19 19 20 20 21 21 22 const bool pruneInvalidRays = false; 22 23 … … 91 92 // CLEAR_CONTAINER(mVssRays); 92 93 } 93 94 94 95 95 -
GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
r1877 r1883 28 28 #include "Preprocessor.h" 29 29 #include "SceneGraph.h" 30 #include "SamplingStrategy.h" 30 31 31 32 … … 1949 1950 Vector3 direction = VssRay::GetDirection(dirVector.x, dirVector.y); 1950 1951 //cout<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; 1951 rays.push_back(SimpleRay(origin, direction)); 1952 rays.push_back(SimpleRay(origin, 1953 direction, 1954 SamplingStrategy::RSS_BASED_DISTRIBUTION, 1955 1.0f 1956 )); 1952 1957 } 1953 1958 } else { … … 2308 2313 2309 2314 //Debug<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; 2310 rays.push_back(SimpleRay(origin, direction)); 2315 rays.push_back(SimpleRay(origin, 2316 direction, 2317 SamplingStrategy::RSS_BASED_DISTRIBUTION, 2318 1.0f 2319 )); 2311 2320 } 2312 2321 … … 2472 2481 if (!intersects) { 2473 2482 //cout<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; 2474 rays.push_back(SimpleRay(origin, direction)); 2483 rays.push_back(SimpleRay(origin, 2484 direction, 2485 SamplingStrategy::RSS_BASED_DISTRIBUTION, 2486 1.0f 2487 )); 2475 2488 generated++; 2476 2489 } … … 2588 2601 if (node->IsLeaf()) { 2589 2602 RssTreeLeaf *leaf = (RssTreeLeaf *)node; 2590 prunned += PruneRaysRandom(leaf, ratio);2591 //prunned += PruneRaysContribution(leaf, ratio);2603 //prunned += PruneRaysRandom(leaf, ratio); 2604 prunned += PruneRaysContribution(leaf, ratio); 2592 2605 } else { 2593 2606 RssTreeInterior *in = (RssTreeInterior *)node; … … 2722 2735 // if small very high importance of the last sample 2723 2736 // if 1.0f then weighs = 1 1/2 1/3 1/4 2724 //float passSampleWeightDecay = 1.0f;2725 float passSampleWeightDecay = 1000.0f;2737 float passSampleWeightDecay = 1.0f; 2738 //float passSampleWeightDecay = 1000.0f; 2726 2739 2727 2740 float … … 2730 2743 int passDiff = mCurrentPass - pass; 2731 2744 float weight; 2732 if ( 1)2745 if (0) 2733 2746 weight = 1.0f/(passDiff + passSampleWeightDecay); 2734 2747 else … … 2777 2790 RssTree::ComputeImportance(RssTreeLeaf *leaf) 2778 2791 { 2792 #if 1 2779 2793 if (leaf->mTotalRays) 2780 2794 leaf->mImportance = leaf->mTotalContribution / leaf->mTotalRays; 2781 2795 else 2782 leaf->mImportance = 0.0f;2796 leaf->mImportance = Limits::Small; 2783 2797 return; 2798 #endif 2784 2799 2785 2800 if (0) -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp
r1771 r1883 10 10 #include "RenderSimulator.h" 11 11 #include "VssRay.h" 12 #include "SamplingStrategy.h" 12 13 13 14 … … 108 109 // cast rays in both directions to make the number of samples comparable 109 110 // with the global sampling method which also casts a "double" ray per sample 110 rays.push_back(SimpleRay(origin, direction)); 111 rays.push_back(SimpleRay(origin, 112 direction, 113 SamplingStrategy::DIRECTION_BASED_DISTRIBUTION, 114 1.0f)); 111 115 i++; 112 116 samples++; -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r1877 r1883 70 70 bool ObjectBasedDistribution::GenerateSample(SimpleRay &ray) 71 71 { 72 Vector3 origin, direction; 73 74 float r[5]; 75 mHalton.GetNext(5, r); 76 77 mPreprocessor.mViewCellsManager->GetViewPoint(origin, Vector3(r[2],r[3],r[4])); 78 79 Vector3 point; 80 Vector3 normal; 81 82 r[0] *= mPreprocessor.mObjects.size()-1; 83 const int i = (int)r[0]; 84 85 Intersectable *object = mPreprocessor.mObjects[i]; 86 87 // take the remainder as a parameter over objects surface 88 r[0] -= (float)i; 89 90 object->GetRandomSurfacePoint(r[0], r[1], point, normal); 91 92 direction = point - origin; 93 94 const float c = Magnitude(direction); 95 96 if (c <= Limits::Small) 97 return false; 98 99 // $$ jb the pdf is yet not correct for all sampling methods! 100 const float pdf = 1.0f; 101 102 direction *= 1.0f / c; 103 ray = SimpleRay(origin, direction, pdf); 104 105 return true; 106 } 107 108 109 bool ObjectDirectionBasedDistribution::GenerateSample(SimpleRay &ray) 72 Vector3 origin, direction; 73 74 float r[5]; 75 mHalton.GetNext(5, r); 76 77 mPreprocessor.mViewCellsManager->GetViewPoint(origin, 78 Vector3(r[2],r[3],r[4])); 79 80 81 Vector3 point, normal; 82 83 r[0] *= mPreprocessor.mObjects.size()-1; 84 const int i = (int)r[0]; 85 86 Intersectable *object = mPreprocessor.mObjects[i]; 87 88 // take the remainder as a parameter over objects surface 89 r[0] -= (float)i; 90 91 object->GetRandomSurfacePoint(r[0], r[1], point, normal); 92 93 direction = point - origin; 94 95 const float c = Magnitude(direction); 96 97 if (c <= Limits::Small) 98 return false; 99 100 // $$ jb the pdf is yet not correct for all sampling methods! 101 const float pdf = 1.0f; 102 103 direction *= 1.0f / c; 104 ray = SimpleRay(origin, direction, OBJECT_BASED_DISTRIBUTION, pdf); 105 106 return true; 107 } 108 109 110 bool 111 ObjectDirectionBasedDistribution::GenerateSample(SimpleRay &ray) 110 112 { 111 Vector3 origin, direction; 112 const int i = (int)RandomValue(0, (Real)mPreprocessor.mObjects.size() - 0.5f); 113 Intersectable *object = mPreprocessor.mObjects[i]; 114 115 Vector3 normal; 116 //cout << "x"; 117 object->GetRandomSurfacePoint(origin, normal); 118 direction = UniformRandomVector(normal); 119 120 origin += 0.1f * direction; 121 122 const float c = Magnitude(direction); 123 124 if (c <= Limits::Small) 125 return false; 126 127 // $$ jb the pdf is yet not correct for all sampling methods! 128 const float pdf = 1.0f; 129 130 direction *= 1.0f / c; 131 ray = SimpleRay(origin, direction, pdf); 132 133 return true; 113 Vector3 origin, direction; 114 115 116 float r[4]; 117 mHalton.GetNext(4, r); 118 119 r[0] *= mPreprocessor.mObjects.size()-1; 120 const int i = (int)r[0]; 121 122 Intersectable *object = mPreprocessor.mObjects[i]; 123 124 // take the remainder as a parameter over objects surface 125 r[0] -= (float)i; 126 127 Vector3 normal; 128 129 object->GetRandomSurfacePoint(r[0], r[1], origin, normal); 130 131 direction = Normalize(CosineRandomVector(r[2], r[3], normal)); 132 133 origin += 1e-2*direction; 134 135 // $$ jb the pdf is yet not correct for all sampling methods! 136 const float pdf = 1.0f; 137 138 ray = SimpleRay(origin, direction, OBJECT_DIRECTION_BASED_DISTRIBUTION, pdf); 139 140 return true; 134 141 } 135 142 … … 149 156 150 157 direction *= 1.0f / c; 151 ray = SimpleRay(origin, direction, pdf);158 ray = SimpleRay(origin, direction, DIRECTION_BASED_DISTRIBUTION, pdf); 152 159 153 160 return true; … … 173 180 174 181 direction *= 1.0f / c; 175 ray = SimpleRay(origin, direction, pdf);182 ray = SimpleRay(origin, direction, DIRECTION_BOX_BASED_DISTRIBUTION, pdf); 176 183 177 184 return true; … … 200 207 201 208 direction *= 1.0f / c; 202 ray = SimpleRay(origin, direction, pdf);209 ray = SimpleRay(origin, direction, SPATIAL_BOX_BASED_DISTRIBUTION, pdf); 203 210 204 211 return true; … … 238 245 point += direction * 0.001f; 239 246 240 ray = SimpleRay(point, direction, pdf);247 ray = SimpleRay(point, direction, REVERSE_OBJECT_BASED_DISTRIBUTION, pdf); 241 248 242 249 return true; … … 279 286 //cout << "p: " << point << " "; 280 287 direction *= 1.0f / c; 281 ray = SimpleRay(origin, direction, pdf);288 ray = SimpleRay(origin, direction, VIEWCELL_BORDER_BASED_DISTRIBUTION, pdf); 282 289 283 290 //cout << "ray: " << ray.mOrigin << " " << ray.mDirection << endl; … … 352 359 point += direction * 0.001f; 353 360 354 ray = SimpleRay(point, direction, pdf);361 ray = SimpleRay(point, direction, REVERSE_VIEWSPACE_BORDER_BASED_DISTRIBUTION, pdf); 355 362 356 363 return true; … … 388 395 origin += direction * 0.001f; 389 396 390 ray = SimpleRay(origin, direction, pdf);397 ray = SimpleRay(origin, direction, VIEWSPACE_BORDER_BASED_DISTRIBUTION, pdf); 391 398 392 399 return true; … … 415 422 mHalton.GetNext(4, r); 416 423 417 #if 0418 #if 0419 r[0] = RandomValue(0,1);420 r[1] = RandomValue(0,1);421 r[2] = RandomValue(0,1);422 r[3] = RandomValue(0,1);423 #else424 r[0] = mHalton.GetNumber(1);425 r[1] = mHalton.GetNumber(2);426 r[2] = mHalton.GetNumber(3);427 r[3] = mHalton.GetNumber(4);428 mHalton.GenerateNext();429 #endif430 #endif431 424 origin = center + (radius*UniformRandomVector(r[0], r[1])); 432 425 termination = center + (radius*UniformRandomVector(r[2], r[3])); 433 426 434 427 direction = termination - origin; 435 //direction = UniformRandomVector();436 428 437 429 … … 458 450 459 451 460 ray = SimpleRay(origin, direction, pdf);452 ray = SimpleRay(origin, direction, GLOBAL_LINES_DISTRIBUTION, pdf); 461 453 ray.mType = Ray::GLOBAL_RAY; 462 454 return true; … … 466 458 } 467 459 468 } 469 470 460 461 // has to called before first usage 462 void 463 MixtureDistribution::Init() 464 { 465 466 } 467 468 // Generate a new sample according to a mixture distribution 469 bool 470 MixtureDistribution::GenerateSample(SimpleRay &ray) 471 { 472 473 return false; 474 } 475 476 // add contributions of the sample to the strategies 477 void 478 MixtureDistribution::UpdateContributions(VssRayContainer &vssRays) 479 { 480 481 } 482 483 } 484 485 -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h
r1877 r1883 1 1 #ifndef _SamplingStategy_H__ 2 2 #define _SamplingStategy_H__ 3 4 #include <vector> 5 using namespace std; 3 6 4 7 #include "Halton.h" … … 10 13 struct SimpleRay; 11 14 class SimpleRayContainer; 15 class VssRayContainer; 12 16 13 17 /** This class generates a specific sampling strategy. … … 21 25 enum 22 26 { 27 DUMMY_DISTRIBUTION = 0, 28 DIRECTION_BASED_DISTRIBUTION, 23 29 OBJECT_BASED_DISTRIBUTION, 24 DIRECTION_BASED_DISTRIBUTION,25 30 DIRECTION_BOX_BASED_DISTRIBUTION, 26 31 SPATIAL_BOX_BASED_DISTRIBUTION, 32 VSS_BASED_DISTRIBUTION, 27 33 RSS_BASED_DISTRIBUTION, 28 34 RSS_SILHOUETTE_BASED_DISTRIBUTION, 29 VSS_BASED_DISTRIBUTION,30 35 OBJECT_DIRECTION_BASED_DISTRIBUTION, 31 36 OBJECTS_INTERIOR_DISTRIBUTION, … … 34 39 VIEWSPACE_BORDER_BASED_DISTRIBUTION, 35 40 REVERSE_VIEWSPACE_BORDER_BASED_DISTRIBUTION, 36 GLOBAL_LINES_DISTRIBUTION 41 GLOBAL_LINES_DISTRIBUTION, 42 GVS 37 43 }; 38 44 … … 101 107 class ObjectDirectionBasedDistribution: public SamplingStrategy 102 108 { 103 public: 109 HaltonSequence mHalton; 110 111 public: 104 112 ObjectDirectionBasedDistribution(const Preprocessor &preprocessor): 105 113 SamplingStrategy(preprocessor) { … … 208 216 { 209 217 public: 210 HaltonSequence mHalton;211 //HaltonSequence mHalton;218 //Halton<4> halton; 219 HaltonSequence mHalton; 212 220 213 221 GlobalLinesDistribution(const Preprocessor &preprocessor): … … 232 240 }; 233 241 */ 242 243 class MixtureDistribution : public SamplingStrategy { 244 public: 245 // halton sequence generator for deciding between distributions 246 HaltonSequence mHalton; 247 248 // container for the distributions 249 vector<SamplingStrategy *> mDistributions; 250 251 MixtureDistribution(const Preprocessor &preprocessor): 252 SamplingStrategy(preprocessor) 253 { 254 } 255 256 // has to called before first usage 257 void Init(); 258 259 // Generate a new sample according to a mixture distribution 260 virtual bool GenerateSample(SimpleRay &ray); 261 262 // add contributions of the sample to the strategies 263 void UpdateContributions(VssRayContainer &vssRays); 264 265 protected: 266 // distributions sorted according to their contribution 267 // used for new sample generation accordint to the pdf 268 vector<SamplingStrategy *> mSortedDistributions; 269 270 }; 271 234 272 }; 235 273 -
GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.cpp
r1867 r1883 228 228 } 229 229 230 231 230 Vector3 232 231 CosineRandomVector(const Vector3 &normal) 233 232 { 234 // float r1 = RandomValue(0.0f, 1.0f);235 // float r2 = RandomValue(0.0f, 1.0f);236 233 float r1, r2; 237 234 238 #if USE_HALTON 239 halton2.GetNext(r1, r2); 240 #else 241 r1 = RandomValue(0.0f, 1.0f); 242 r2 = RandomValue(0.0f, 1.0f); 243 #endif 244 245 float theta = 2.0f*M_PI*r2; 246 float radius = sqrt(r1); 247 float x = radius*sin(theta); 248 float z = radius*cos(theta); 249 float y = sqrt(1.0f - x*x - z*z); 250 235 r1 = RandomValue(0.0f, 1.0f); 236 r2 = RandomValue(0.0f, 1.0f); 237 238 return CosineRandomVector(r1, r2, normal); 239 } 240 241 Vector3 242 CosineRandomVector(const float r1, 243 const float r2, 244 const Vector3 &normal) 245 { 246 float theta = 2.0f*M_PI*r2; 247 float radius = sqrt(r1); 248 float x = radius*sin(theta); 249 float z = radius*cos(theta); 250 float y = sqrt(1.0f - x*x - z*z); 251 252 Vector3 dir(x, 253 y, 254 z); 255 256 // return Normalize(dir); 251 257 252 Vector3 dir(x, 253 y, 254 z); 255 256 257 // return Normalize(dir); 258 259 Matrix4x4 m = RotationVectorsMatrix( 260 normal, 261 Vector3(0,1,0)); 262 Matrix4x4 mi = Invert(m); 263 m = m*RotationVectorsMatrix( 264 Vector3(0,1,0), 265 Normalize(dir))*mi; 266 267 return TransformNormal(m, normal); 258 Matrix4x4 m = RotationVectorsMatrix( 259 normal, 260 Vector3(0,1,0) 261 ); 262 Matrix4x4 mi = Invert(m); 263 m = m*RotationVectorsMatrix( 264 Vector3(0,1,0), 265 Normalize(dir))*mi; 266 267 return TransformNormal(m, normal); 268 268 } 269 269 -
GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.h
r1867 r1883 240 240 UniformRandomVector(const float r1, const float r2); 241 241 242 friend Vector3 UniformRandomVector(const Vector3 &normal, 243 const float r1, 244 const float r2 245 ); 242 friend Vector3 CosineRandomVector( 243 const float r1, 244 const float r2, 245 const Vector3 &normal 246 ); 246 247 247 248 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1877 r1883 24 24 #include "SamplingStrategy.h" 25 25 #include "SceneGraph.h" 26 27 28 26 29 27 -
GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
r1771 r1883 15 15 #include "Intersectable.h" 16 16 #include "RayCaster.h" 17 #include "SamplingStrategy.h" 17 18 18 19 … … 422 423 const Vector3 direction = GetDirection(viewpoint, &mViewCellsManager->GetViewSpaceBox()); 423 424 424 const SimpleRay sray(viewpoint, direction); 425 sampleContributions = mRayCaster->CastRay(sray, mVssRays, mViewCellsManager->GetViewSpaceBox(), true); 425 const SimpleRay sray(viewpoint, direction, 426 SamplingStrategy::DIRECTION_BOX_BASED_DISTRIBUTION, 427 1.0f); 428 sampleContributions = mRayCaster->CastRay(sray, 429 mVssRays, 430 mViewCellsManager->GetViewSpaceBox(), 431 true); 426 432 427 433 if (sampleContributions) { … … 545 551 mViewCellsManager->GetViewPoint(viewpoint); 546 552 Vector3 direction = GetDirection(viewpoint, NULL); 547 rays.push_back(SimpleRay(viewpoint, direction)); 553 rays.push_back(SimpleRay(viewpoint, direction, 554 SamplingStrategy::DIRECTION_BOX_BASED_DISTRIBUTION, 555 1.0f) 556 ); 548 557 } 549 558 } else { -
GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.h
r1867 r1883 14 14 class KdNode; 15 15 16 #define ABS_CONTRIBUTION_WEIGHT 0.9f16 #define ABS_CONTRIBUTION_WEIGHT 1.0f 17 17 18 18 class VssRay { … … 67 67 short mPass; 68 68 69 // Distribution used to generate this ray 70 short mDistribution; 71 69 72 // number of cells where this ray made a contribution to the PVS 70 short mPvsContribution;73 int mPvsContribution; 71 74 72 75 // sum of relative ray contributions per object -
GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.cpp
r1824 r1883 24 24 #include "Intersectable.h" 25 25 #include "Ray.h" 26 #include "SamplingStrategy.h" 26 27 27 28 namespace GtpVisibilityPreprocessor { … … 1672 1673 Vector3 direction = VssRay::GetDirection(dirVector.x, dirVector.y); 1673 1674 //cout<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; 1674 rays.push_back(SimpleRay(origin, direction ));1675 rays.push_back(SimpleRay(origin, direction, SamplingStrategy::VSS_BASED_DISTRIBUTION, 1.0f)); 1675 1676 } 1676 1677 … … 1754 1755 } 1755 1756 //cout<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; 1756 rays.push_back(SimpleRay(origin, direction ));1757 rays.push_back(SimpleRay(origin, direction, SamplingStrategy::VSS_BASED_DISTRIBUTION, 1.0f)); 1757 1758 } 1758 1759 } -
GTP/trunk/Lib/Vis/Preprocessing/src/default.env
r1877 r1883 90 90 RssPreprocessor { 91 91 92 distributions rss+spatial+object 92 distributions rss+spatial+object_direction 93 # distributions object_direction 93 94 94 95 samplesPerPass 1000 … … 127 128 # splitType heuristic 128 129 129 minRays 200130 minRays 100 130 131 minSize 0.001 131 132 maxCostRatio 1.0 -
GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro
r1876 r1883 19 19 20 20 CONFIG(qt) { 21 win32:INCLUDEPATH += "d:/Programs/NVIDIA Corporation/Cg/include"22 #win32:INCLUDEPATH += "c:/Program Files/NVIDIA Corporation/Cg/include"21 #win32:INCLUDEPATH += "d:/Programs/NVIDIA Corporation/Cg/include" 22 win32:INCLUDEPATH += "$$(CG_INC_PATH)" 23 23 } 24 24 … … 32 32 33 33 CONFIG(qt) { 34 win32:LIBPATH += "d:/Programs/NVIDIA Corporation/Cg/lib"35 #win32:LIBPATH += "c:/Program Files/NVIDIA Corporation/Cg/lib"34 #win32:LIBPATH += "d:/Programs/NVIDIA Corporation/Cg/lib" 35 win32:LIBPATH += "$$(CG_LIB_PATH)" 36 36 } 37 37 -
GTP/trunk/Lib/Vis/Preprocessing/src/run_test2
r1877 r1883 2 2 3 3 #COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 4 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter -"4 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter+" 5 5 6 6 #SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d" … … 29 29 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 30 30 31 PREFIX=../work/plots/osp-rss -1e531 PREFIX=../work/plots/osp-rss2-1e5 32 32 33 33 #SCENE=../data/atlanta/atlanta2.x3d … … 40 40 41 41 42 # $COMMAND -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 43 # -rss_update_subdivision+ -rss_split=hybrid -hybrid_depth=10 \ 44 # -view_cells_filter_max_size=1 -preprocessor_stats=$PREFIX-i-combined-update-ccb12-nn.log \ 45 # -preprocessor_histogram_file=$PREFIX-i-combined-update-ccb12-nn.hlog 46 42 47 $COMMAND -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 43 -rss_use_importance+ -rss_use_rss_tree+ -rss_update_subdivision+ -rss_split=hybrid -hybrid_depth=10 \ 44 -view_cells_filter_max_size=1 -preprocessor_stats=$PREFIX-i-combined-update-ccb12-nn.log \ 45 -preprocessor_histogram_file=$PREFIX-i-combined-update-ccb12-nn.hlog 46 48 -rss_update_subdivision- -rss_split=hybrid -hybrid_depth=10 \ 49 -view_cells_filter_max_size=1 -preprocessor_stats=$PREFIX-i-combined-ccb12-nn.log \ 50 -preprocessor_histogram_file=$PREFIX-i-combined-ccb12-nn.hlog 47 51 48 52 … … 60 64 61 65 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-n.log \65 -preprocessor_histogram_file=$PREFIX-i-mixed-b1-n.hlog66 #$COMMAND -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 67 #-rss_distributions=spatial+object_direction -view_cells_filter_max_size=1 \ 68 # -preprocessor_stats=$PREFIX-i-mixed-b1-n.log \ 69 # -preprocessor_histogram_file=$PREFIX-i-mixed-b1-n.hlog 66 70 67 71
Note: See TracChangeset
for help on using the changeset viewer.