Changeset 2846


Ignore:
Timestamp:
07/17/08 23:23:47 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env

    r2845 r2846  
    1010winHeight=768 
    1111camPosition=483.398f 242.364f 186.078f 
    12 camDirection=1 1 0 
     12camDirection=1 0 0 
    1313useFullScreen=0 
     14#modelPath=data/city/model/ 
     15 
    1416 
    1517############ 
    1618# shader stuff 
     19 
    1720expFactor=0.1f 
    1821#numSsaoSamples=8 
    19 #0699/11384251 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp

    r2845 r2846  
    121121                Texture *tex = new Texture(model_path + texname); 
    122122 
     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 
    123136                mTextureTable[i] = tex; 
    124137                mTextures.push_back(tex); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.cpp

    r2845 r2846  
    2929 
    3030Texture::Texture(const std::string &filename): 
    31 mWidth(0), mHeight(0), mFormat(0), mImage(NULL), mTexId(-1), mName(filename) 
     31mWidth(0),  
     32mHeight(0),  
     33mFormat(0),  
     34mImage(NULL),  
     35mTexId(-1),  
     36mName(filename), 
     37mBoundaryModeS(REPEAT), 
     38mBoundaryModeT(REPEAT) 
    3239{ 
    3340        startil(); 
     
    5360         
    5461        stopil(); 
    55  
    56         Create(); 
    5762} 
    5863 
     
    7378        //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 
    7479 
    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); 
    7781 
    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); 
    8087 
    8188        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  
    2727        enum { FORMAT_INVALID, FORMAT_RGB, FORMAT_RGBA }; 
    2828         
     29        enum { CLAMP, REPEAT }; 
     30 
    2931        /** Returns width of texture. 
    3032        */ 
     
    4951        void Bind() const; 
    5052 
     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(); 
    5162 
    5263 
    5364protected: 
    54  
    55         void Create(); 
    5665 
    5766        int mFormat; 
     
    6069 
    6170        unsigned int mTexId; 
     71 
     72        int mBoundaryModeS; 
     73        int mBoundaryModeT; 
    6274 
    6375        std::string mName; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r2845 r2846  
    342342                env.GetVectorParam(string("camDirection"), camDir); 
    343343 
     344                //env.GetStringParam(string("modelPath"), model_path); 
    344345                //env.GetIntParam(string("numSssaoSamples"), numSsaoSamples); 
    345346 
     
    355356                cout << "camPosition: " << camPos << endl; 
    356357                cout << "expFactor: " << expFactor << endl; 
     358                //cout << "model path: " << model_path << endl; 
    357359        } 
    358360 
Note: See TracChangeset for help on using the changeset viewer.