Changeset 2846 for GTP/trunk/App
- Timestamp:
- 07/17/08 23:23:47 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r2845 r2846 10 10 winHeight=768 11 11 camPosition=483.398f 242.364f 186.078f 12 camDirection=1 1012 camDirection=1 0 0 13 13 useFullScreen=0 14 #modelPath=data/city/model/ 15 14 16 15 17 ############ 16 18 # shader stuff 19 17 20 expFactor=0.1f 18 21 #numSsaoSamples=8 19 #0699/11384251 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp
r2845 r2846 121 121 Texture *tex = new Texture(model_path + texname); 122 122 123 int boundS, boundT; 124 125 str.read(reinterpret_cast<char *>(&boundS), sizeof(int)); 126 str.read(reinterpret_cast<char *>(&boundT), sizeof(int)); 127 128 tex->SetBoundaryModeS(boundS); 129 tex->SetBoundaryModeT(boundT); 130 131 //tex->SetBoundaryModeS(Texture::CLAMP); 132 //tex->SetBoundaryModeT(Texture::CLAMP); 133 134 tex->Create(); 135 123 136 mTextureTable[i] = tex; 124 137 mTextures.push_back(tex); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.cpp
r2845 r2846 29 29 30 30 Texture::Texture(const std::string &filename): 31 mWidth(0), mHeight(0), mFormat(0), mImage(NULL), mTexId(-1), mName(filename) 31 mWidth(0), 32 mHeight(0), 33 mFormat(0), 34 mImage(NULL), 35 mTexId(-1), 36 mName(filename), 37 mBoundaryModeS(REPEAT), 38 mBoundaryModeT(REPEAT) 32 39 { 33 40 startil(); … … 53 60 54 61 stopil(); 55 56 Create();57 62 } 58 63 … … 73 78 //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 74 79 75 //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 76 //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 80 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 4); 77 81 78 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); 79 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); 82 int glWrapModeS = (mBoundaryModeS == REPEAT) ? GL_REPEAT : GL_CLAMP_TO_EDGE; 83 int glWrapModeT = (mBoundaryModeT == REPEAT) ? GL_REPEAT : GL_CLAMP_TO_EDGE; 84 85 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, glWrapModeS); 86 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, glWrapModeT); 80 87 81 88 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, mWidth, mHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, mImage); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.h
r2782 r2846 27 27 enum { FORMAT_INVALID, FORMAT_RGB, FORMAT_RGBA }; 28 28 29 enum { CLAMP, REPEAT }; 30 29 31 /** Returns width of texture. 30 32 */ … … 49 51 void Bind() const; 50 52 53 void SetBoundaryModeS(int mode) { mBoundaryModeS = mode; } 54 void SetBoundaryModeT(int mode) { mBoundaryModeT = mode; } 55 56 int GetBoundaryModeS() const { return mBoundaryModeS; } 57 int GetBoundaryModeT() const { return mBoundaryModeT; } 58 59 /** Creates the texture from the image 60 */ 61 void Create(); 51 62 52 63 53 64 protected: 54 55 void Create();56 65 57 66 int mFormat; … … 60 69 61 70 unsigned int mTexId; 71 72 int mBoundaryModeS; 73 int mBoundaryModeT; 62 74 63 75 std::string mName; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2845 r2846 342 342 env.GetVectorParam(string("camDirection"), camDir); 343 343 344 //env.GetStringParam(string("modelPath"), model_path); 344 345 //env.GetIntParam(string("numSssaoSamples"), numSsaoSamples); 345 346 … … 355 356 cout << "camPosition: " << camPos << endl; 356 357 cout << "expFactor: " << expFactor << endl; 358 //cout << "model path: " << model_path << endl; 357 359 } 358 360
Note: See TracChangeset
for help on using the changeset viewer.