- Timestamp:
- 08/27/08 15:09:04 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp
r2865 r2873 19 19 void PoissonDiscSampleGenerator::Generate(Sample2 *samples) const 20 20 { 21 // this is a hacky poisson sampling generator which does random dart-throwing 22 // until it is not able to place any dart for a number of tries 23 // in this case, the required min distance is reduced 24 // the solution is a possion sampling with respect to the adjusted min distance 25 // better solutions have been proposed, i.e., using hierarchical sampling 26 27 const float maxTries = 1000; 28 const float f_reduction = 0.9f; 29 21 30 static HaltonSequence halton; 22 31 float r[2]; 23 32 24 33 // generates poisson distribution on disc 25 float minDist = 4.0f / sqrt((float)mNumSamples);34 float minDist = 2.0f / sqrt((float)mNumSamples); 26 35 27 36 //cout << "minDist before= " << minDist << endl; … … 66 75 } 67 76 68 if (tries > 2000)77 if (tries > maxTries) 69 78 { 70 minDist *= 0.9f;79 minDist *= f_reduction; 71 80 tries = 0; 72 81 }
Note: See TracChangeset
for help on using the changeset viewer.