Changeset 3338 for GTP/trunk/App/Demos
- Timestamp:
- 03/13/09 17:42:47 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/MainApp.vcproj
r3294 r3338 156 156 IgnoreAllDefaultLibraries="false" 157 157 IgnoreDefaultLibraryNames="LIBCMT" 158 GenerateDebugInformation=" false"158 GenerateDebugInformation="true" 159 159 SubSystem="1" 160 160 LargeAddressAware="2" -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3333 r3338 212 212 } 213 213 214 QuadraticDiscSampleGenerator2D nixgibts(NUM_SAMPLES, 1.0f);215 216 214 /** Generate poisson disc distributed sample points on the unit disc 217 215 */ … … 222 220 case DeferredRenderer::SAMPLING_POISSON: 223 221 { 224 static PoissonDiscSampleGenerator2D poisson(NUM_SAMPLES, 1.0f);222 PoissonDiscSampleGenerator2D poisson(NUM_PRECOMPUTED_SAMPLES, 1.0f); 225 223 poisson.Generate((float *)samples2); 226 224 } … … 228 226 case DeferredRenderer::SAMPLING_QUADRATIC: 229 227 { 228 //PoissonDiscSampleGenerator2D poisson(NUM_PRECOMPUTED_SAMPLES, 1.0f); 229 //poisson.Generate((float *)samples2); 230 230 QuadraticDiscSampleGenerator2D g(NUM_PRECOMPUTED_SAMPLES, 1.0f); 231 //static QuadraticDiscSampleGenerator2D g(NUM_SAMPLES, 1.0f);232 231 g.Generate((float *)samples2); 233 232 } … … 235 234 default: // SAMPLING_DEFAULT 236 235 { 237 staticRandomSampleGenerator2D g(NUM_SAMPLES, 1.0f);236 RandomSampleGenerator2D g(NUM_SAMPLES, 1.0f); 238 237 g.Generate((float *)samples2); 239 238 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp
r3329 r3338 51 51 int tries = 0; 52 52 53 //cout << "minDist before= " << minDist << endl;53 cout << "minDist before= " << minDist << endl; 54 54 Sample2 *s = (Sample2 *)samples; 55 55 … … 64 64 //mHalton->GetNext(r); 65 65 66 #if 0 66 67 // scale to -1 .. 1 67 68 const float rx = r[0] * 2.0f - 1.0f; … … 70 71 // check if in disk, else exit early 71 72 const float distanceSquared = rx * rx + ry * ry; 72 73 if ((rx * rx + ry * ry > mRadius * mRadius) 74 // also avoid case that sample exactly in center 73 if (rx * rx + ry * ry > mRadius * mRadius) 74 // also avoid case that sample exactly in center 75 75 //|| (distanceSquared <= 1e-3f) 76 )76 { 77 77 continue; 78 } 79 #else 80 const float rx = r[0]; 81 const float ry = r[1]; 82 #endif 78 83 79 84 bool sampleValid = true; … … 109 114 } 110 115 111 //cout << "minDist after= " << (float)minDist / mNumSamples<< " #tries: " << tries << endl; 116 for (int i = 0; i < mNumSamples; ++ i) 117 { 118 const float a = 2.0f * M_PI * s[i].x; 119 const float r = sqrt(s[i].y); 120 121 const float rad = mRadius * r; 122 123 s[i].x = rad * cos(a); 124 s[i].y = rad * sin(a); 125 } 126 127 cout << "minDist after= " << (float)minDist / mNumSamples<< " #tries: " << tries << endl; 112 128 } 113 129 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3335 r3338 1179 1179 Matrix4x4 rotMatrix2 = RotationZMatrix(rotAngle); 1180 1180 // hack: second buddha 1181 dynamicObjects[3]->GetTransform()->MultMatrix(rotMatrix2);1181 //dynamicObjects[3]->GetTransform()->MultMatrix(rotMatrix2); 1182 1182 1183 1183
Note: See TracChangeset
for help on using the changeset viewer.