Changeset 1899 for GTP/trunk/Lib/Vis
- Timestamp:
- 12/15/06 18:01:34 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1895 r1899 646 646 renderCostDecr); 647 647 648 if ( 0)648 if (USE_AVGRAYCONTRI) 649 649 { 650 650 // this leaf is a pvs entry in all the view cells … … 657 657 AvgRayContribution(pvs, splitCandidate.mParentData.mNumRays); 658 658 659 Debug << "bvh avgRayContri: " << avgRayContri << " #pvs: " << pvs << " #rays: " << splitCandidate.mParentData.mNumRays << endl;660 cout << "bvh avgRayContri: " << avgRayContri << endl;659 //Debug << "bvh avgRayContri: " << avgRayContri << " #pvs: " << pvs << " #rays: " << splitCandidate.mParentData.mNumRays << endl; 660 //cout << "bvh avgRayContri: " << avgRayContri << endl; 661 661 662 662 // high avg ray contri, the result is influenced by undersampling … … 665 665 { 666 666 const float factor = 1.0f + avgRayContri - mHierarchyManager->mMaxAvgRayContri; 667 cout << "here5 " << factor << endl;668 669 667 priority /= factor; 670 668 } -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1895 r1899 780 780 // high avg ray contri, the result is influenced by undersampling 781 781 // => decrease priority 782 if ( 0&& (sc->GetAvgRayContribution() > mMaxAvgRayContri))782 if (USE_AVGRAYCONTRI && (sc->GetAvgRayContribution() > mMaxAvgRayContri)) 783 783 { 784 784 const float factor = 1.0f + sc->GetAvgRayContribution() - mMaxAvgRayContri; 785 cout << "h ere5" << factor << endl;785 cout << "h " << factor << endl; 786 786 787 787 mem *= factor; -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r1895 r1899 45 45 46 46 #define COUNT_ORIGIN_OBJECTS 1 47 47 #define USE_AVGRAYCONTRI 1 48 48 /** View space / object space hierarchy statistics. 49 49 */ -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r1898 r1899 9 9 namespace GtpVisibilityPreprocessor { 10 10 11 HaltonSequence SamplingStrategy::sHalton; 11 12 HaltonSequence ObjectBasedDistribution::sHalton; 13 HaltonSequence MixtureDistribution::sHalton; 14 HaltonSequence GlobalLinesDistribution::sHalton; 15 HaltonSequence SpatialBoxBasedDistribution::sHalton; 16 HaltonSequence ObjectDirectionBasedDistribution::sHalton; 17 12 18 13 19 SamplingStrategy::SamplingStrategy(Preprocessor &preprocessor): … … 132 138 direction = Normalize(CosineRandomVector(r[2], r[3], normal)); 133 139 134 origin += 1e-2 *direction;140 origin += 1e-2f*direction; 135 141 136 142 // $$ jb the pdf is yet not correct for all sampling methods! -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h
r1898 r1899 84 84 85 85 Preprocessor &mPreprocessor; 86 static HaltonSequence sHalton;87 86 }; 88 87 … … 91 90 { 92 91 public: 93 //HaltonSequence mHalton;92 94 93 95 94 ObjectBasedDistribution(Preprocessor &preprocessor): … … 100 99 private: 101 100 virtual bool GenerateSample(SimpleRay &ray); 101 102 static HaltonSequence sHalton; 102 103 }; 103 104 … … 119 120 class ObjectDirectionBasedDistribution: public SamplingStrategy 120 121 { 121 //HaltonSequence mHalton;122 122 123 123 public: … … 126 126 mType = OBJECT_DIRECTION_BASED_DISTRIBUTION; 127 127 } 128 private: 128 129 private: 130 131 static HaltonSequence sHalton; 129 132 virtual bool GenerateSample(SimpleRay &ray); 130 133 }; … … 159 162 { 160 163 public: 161 //HaltonSequence mHalton; 162 164 165 SpatialBoxBasedDistribution(Preprocessor &preprocessor): 163 166 SamplingStrategy(preprocessor){ 164 167 mType = SPATIAL_BOX_BASED_DISTRIBUTION; … … 167 170 private: 168 171 virtual bool GenerateSample(SimpleRay &ray); 172 173 static HaltonSequence sHalton; 169 174 }; 170 175 … … 196 201 197 202 198 199 200 203 class ViewCellBorderBasedDistribution: public SamplingStrategy 201 204 { … … 206 209 207 210 } 208 211 212 private: 209 213 virtual bool GenerateSample(SimpleRay &ray); 210 214 }; … … 213 217 { 214 218 public: 215 //Halton<4> halton; 216 //HaltonSequence mHalton; 217 219 218 220 GlobalLinesDistribution(Preprocessor &preprocessor): 219 221 SamplingStrategy(preprocessor) { … … 221 223 } 222 224 223 virtual bool GenerateSample(SimpleRay &ray); 225 private: 226 227 virtual bool GenerateSample(SimpleRay &ray); 228 229 static HaltonSequence sHalton; 224 230 }; 225 231 … … 238 244 */ 239 245 240 class MixtureDistribution : public SamplingStrategy 241 { 242 public: 243 // halton sequence generator for deciding between distributions 244 //HaltonSequence mHalton; 245 246 class MixtureDistribution: public SamplingStrategy 247 { 248 public: 249 246 250 // container for the distributions 247 251 vector<SamplingStrategy *> mDistributions; … … 259 263 Reset(); 260 264 261 // Generate a new sample according to a mixture distribution262 virtual bool GenerateSample(SimpleRay &ray);263 264 265 // add contributions of the sample to the strategies 265 266 void ComputeContributions(VssRayContainer &vssRays); … … 272 273 Construct(char *str); 273 274 275 private: 276 277 // Generate a new sample according to a mixture distribution 278 virtual bool GenerateSample(SimpleRay &ray); 279 280 // halton sequence generator for deciding between distributions 281 static HaltonSequence sHalton; 274 282 275 283 }; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1895 r1899 860 860 // avg ray contri 861 861 862 if ( 0)862 if (USE_AVGRAYCONTRI) 863 863 { 864 864 const int pvs = EvalPvsEntriesSize(*splitCandidate.mParentData.mRays); 865 865 const float avgRayContri = (float)pvs / ((float)splitCandidate.mParentData.mRays->size() + Limits::Small); 866 866 867 Debug << "vsp avgRayContri: " << avgRayContri << " #pvs: " << pvs << " #rays: " << splitCandidate.mParentData.mRays->size() << endl;868 cout << "vsp avgRayContri: " << avgRayContri << endl;867 //Debug << "vsp avgRayContri: " << avgRayContri << " #pvs: " << pvs << " #rays: " << splitCandidate.mParentData.mRays->size() << endl; 868 //cout << "vsp avgRayContri: " << avgRayContri << endl; 869 869 870 870 // high avg ray contri very, the result is influenced by undersampling
Note: See TracChangeset
for help on using the changeset viewer.