Changeset 2850 for GTP/trunk/App
- Timestamp:
- 08/08/08 07:52:54 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/CHCPlusPlusTraverser.cpp
r2802 r2850 27 27 { 28 28 BvhNode *node = query->GetNodes()[i]; 29 #if 1 29 30 30 mIQueue.push_back(node); 31 31 node->SetLastQueriedFrame(mFrameId); 32 #else33 OcclusionQuery *q = IssueOcclusionQuery(node);34 mQueryQueue.push(q);35 #endif36 32 } 37 33 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderState.cpp
r2845 r2850 88 88 { 89 89 mCullFaceEnabled = true; 90 glEnable(GL_CULL_FACE);90 //glEnable(GL_CULL_FACE); 91 91 } 92 92 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp
r2848 r2850 68 68 str.read(reinterpret_cast<char *>(&distance), sizeof(float)); 69 69 70 // hack 71 distance = i * 20; 72 70 73 int numShapes; 71 74 str.read(reinterpret_cast<char *>(&numShapes), sizeof(int)); … … 80 83 str.read(reinterpret_cast<char *>(&shapeId), sizeof(int)); 81 84 82 //if (numLODs > 1) cout << " id " << shapeId;83 84 85 Geometry *geom = mGeometryTable[shapeId]; 85 86 Material *mat = mMaterialTable[shapeId]; … … 128 129 tex->SetBoundaryModeS(boundS); 129 130 tex->SetBoundaryModeT(boundT); 130 131 //tex->SetBoundaryModeS(Texture::CLAMP);132 //tex->SetBoundaryModeT(Texture::CLAMP);133 131 134 132 tex->Create(); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.cpp
r2846 r2850 36 36 mName(filename), 37 37 mBoundaryModeS(REPEAT), 38 mBoundaryModeT(REPEAT) 38 mBoundaryModeT(REPEAT), 39 mUseMipMap(true) 39 40 { 40 41 startil(); … … 72 73 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 73 74 74 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);75 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);76 77 //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);78 //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);79 80 75 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 4); 81 76 … … 86 81 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, glWrapModeT); 87 82 83 if (mUseMipMap) 84 { 85 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 86 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); 87 } 88 else 89 { 90 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 91 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 92 } 93 88 94 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, mWidth, mHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, mImage); 89 gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, mWidth, mHeight, GL_RGBA, GL_UNSIGNED_BYTE, mImage); 95 96 if (mUseMipMap) 97 gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, mWidth, mHeight, GL_RGBA, GL_UNSIGNED_BYTE, mImage); 90 98 91 99 glBindTexture(GL_TEXTURE_2D, 0); … … 153 161 } 154 162 163 164 165 155 166 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.h
r2846 r2850 54 54 void SetBoundaryModeT(int mode) { mBoundaryModeT = mode; } 55 55 56 //void SetUseMipMap(bool useMipMap) { mUseMipMap = useMipMap; } 57 56 58 int GetBoundaryModeS() const { return mBoundaryModeS; } 57 59 int GetBoundaryModeT() const { return mBoundaryModeT; } … … 60 62 */ 61 63 void Create(); 64 62 65 63 66 … … 77 80 int mByteSize; 78 81 void *mImage; 82 83 bool mUseMipMap; 79 84 }; 80 85 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2848 r2850 376 376 glutInitWindowSize(winWidth, winHeight); 377 377 glutInit(&argc, argv); 378 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); 378 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_MULTISAMPLE); 379 380 //glutInitDisplayString("samples=2"); 379 381 380 382 if (!useFullScreen) … … 397 399 398 400 // initialise gl graphics 399 400 401 InitExtensions(); 401 402 InitGLstate(); 402 403 404 glEnable(GL_MULTISAMPLE_ARB); 405 glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB); 406 glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_NICEST); 407 403 408 InitFBO(); 404 409 … … 665 670 666 671 glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA32F_ARB, texWidth, texHeight); 672 667 673 int samples = 8; 668 674 //glEnable(GL_MULTISAMPLE_ARB); … … 863 869 glFrontFace(GL_CCW); 864 870 glCullFace(GL_BACK); 865 glEnable(GL_CULL_FACE); 871 //glEnable(GL_CULL_FACE); 872 866 873 glDisable(GL_CULL_FACE); 867 874 glDisable(GL_TEXTURE_2D);
Note: See TracChangeset
for help on using the changeset viewer.