Changeset 2853 for GTP/trunk/App
- Timestamp:
- 08/19/08 16:36:13 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/FriendlyCulling.vcproj
r2847 r2853 284 284 </File> 285 285 <File 286 RelativePath=".\src\SampleGenerator.cpp" 287 > 288 </File> 289 <File 290 RelativePath=".\src\SampleGenerator.h" 291 > 292 </File> 293 <File 286 294 RelativePath=".\src\SceneQuery.cpp" 287 295 > -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/LODInfo.h
r2848 r2853 10 10 11 11 /** Class representing information about an LOD level. 12 The distance parameter indicates the distance where this 13 lod level is invoked - if the parameter value is smaller or equal 14 than the distance to the view point. 12 15 */ 13 16 struct LODLevel -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Plane3.h
r2782 r2853 16 16 Plane3() {} 17 17 18 //Plane3(const Vector3 &normal, float dist);19 20 18 Plane3(const Vector3 &a, const Vector3 &b, const Vector3 &c); 21 19 … … 27 25 mD *= -1; 28 26 } 29 /** Get dis ance topoint.27 /** Get distance to a point. 30 28 */ 31 29 inline float Distance(const Vector3 &v) const … … 73 71 Vector3 mNormal; 74 72 float mD; 75 76 //////////////////77 78 73 }; 79 74 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp
r2852 r2853 60 60 //-- load lod levels 61 61 62 // note: lods must be ordered from smallest distance to largest 62 63 int numLODs; 63 64 str.read(reinterpret_cast<char *>(&numLODs), sizeof(int)); … … 65 66 for (int i = 0; i < numLODs; ++ i) 66 67 { 67 float dist ance;68 str.read(reinterpret_cast<char *>(&dist ance), sizeof(float));68 float dist; 69 str.read(reinterpret_cast<char *>(&dist), sizeof(float)); 69 70 70 71 int numShapes; 71 72 str.read(reinterpret_cast<char *>(&numShapes), sizeof(int)); 72 73 73 LODLevel *lodLevel = new LODLevel(dist ance);74 LODLevel *lodLevel = new LODLevel(dist); 74 75 75 76 for (int j = 0; j < numShapes; ++ j) -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.cpp
r2848 r2853 35 35 const Vector3 pos = GetCenter(); 36 36 37 const float dist ance= SqrDistance(pos, viewPoint);37 const float dist = SqrDistance(pos, viewPoint); 38 38 39 39 mCurrentLODLevel = 0; 40 40 41 // note: we assume that lods are ordered from smallest distance to largest 41 42 const int l = (int)mLODLevels.size(); 42 43 … … 45 46 LODLevel *lod = mLODLevels[i]; 46 47 47 if (lod->GetSquaredDistance() > dist ance)48 if (lod->GetSquaredDistance() > dist) 48 49 break; 49 50 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2851 r2853 31 31 #include "Halton.h" 32 32 #include "Transform3.h" 33 #include "SampleGenerator.h" 33 34 34 35 … … 188 189 bool useFullScreen = false; 189 190 190 float expFactor = 0.1f; 191 // exp factor for ssao 192 float expFactor = 0.05f; 191 193 192 194 // ssao number of samples … … 376 378 glutInitWindowSize(winWidth, winHeight); 377 379 glutInit(&argc, argv); 378 //glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_MULTISAMPLE);379 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);380 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_MULTISAMPLE); 381 //glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); 380 382 381 383 //glutInitDisplayString("samples=2"); … … 2041 2043 bool validIntersect = sceneQuery->CalcIntersection(playerPos); 2042 2044 2043 if (validIntersect 2045 if (validIntersect) 2044 2046 // && ((playerPos.z - oldPos.z) < bvh->GetBox().Size(2) * 1e-1f)) 2045 2047 { … … 2271 2273 void GenerateSamples() 2272 2274 { 2273 static HaltonSequence halton;2275 /*static HaltonSequence halton; 2274 2276 2275 2277 float r[2]; … … 2328 2330 } 2329 2331 } 2330 //cout << "sample: " << samples[i] << " " << i / 2 << " " << samples[i + 1] << " r: " << sqrt(samples[i] * samples[i] + samples[i + 1] * samples[i + 1]) << " tries: " << totalTries << endl; 2331 } 2332 2333 //cout << "minDist after= " << minDist << endl; 2332 } 2333 */ 2334 2335 static PoissonDiscSampleGenerator poisson(NUM_SAMPLES, 1.0f); 2336 poisson.Generate((Sample2 *)samples); 2334 2337 } 2335 2338 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r2838 r2853 10 10 //#define SAMPLE_INTENSITY 0.125f 11 11 12 #define AREA_SIZE 5e-1f12 #define AREA_SIZE 9e-1f 13 13 #define VIEW_CORRECTION_SCALE 0.3f 14 14 #define DISTANCE_SCALE 1e-6f … … 254 254 (tex.y >= 0.0f) && (tex.y < 1.0f) && 255 255 (abs(depthDif) < 8e-5f)) 256 { 256 257 OUT.color = attenuated_color * expFactor + col1 * float4(1.0f - expFactor); 258 } 257 259 else 260 { 258 261 OUT.color = attenuated_color; 262 } 259 263 260 264 OUT.color.w = tex2D(colors, IN.texCoord.xy).w;
Note: See TracChangeset
for help on using the changeset viewer.