Re: [Plib-devel] texture repeating
Brought to you by:
sjbaker
From: Curtis L. O. <cu...@me...> - 2000-08-25 19:24:04
|
Steve Baker writes: > Old Evans&Sutherland image generators didn't have MIPmapping and used > 'contrast clamping' to manage aliasing - it didn't work all that well, > but it was certainly better than doing nothing. They altered the texture > contrast as a function of range and orientation. > > I'm not sure that helps. I might have to just say runway markings are going to suck in the short term until you buy better hardware ... > > Would you like the changes for ssg anyway ... they are pretty minimal ... > > Yes please. Ok, here they are ... I don't have cvs write access but the changes are very short so I'll just post them here: curt@lilith$ diff -cr plib-1.2.0/src/ssg/ plib-1.2.0-new/src/ssg/ diff -cr plib-1.2.0/src/ssg/ssg.h plib-1.2.0-new/src/ssg/ssg.h *** plib-1.2.0/src/ssg/ssg.h Tue Jun 27 20:34:04 2000 --- plib-1.2.0-new/src/ssg/ssg.h Fri Aug 25 12:31:16 2000 *************** *** 442,448 **** public: virtual ssgBase *clone ( int clone_flags = 0 ) ; ! ssgTexture ( char *fname, int wrapu = TRUE, int wrapv = TRUE ) { #ifdef GL_VERSION_1_1 glGenTextures ( 1, & handle ) ; --- 442,449 ---- public: virtual ssgBase *clone ( int clone_flags = 0 ) ; ! ssgTexture ( char *fname, int wrapu = TRUE, int wrapv = TRUE, ! int mipmap = TRUE ) { #ifdef GL_VERSION_1_1 glGenTextures ( 1, & handle ) ; *************** *** 463,470 **** glTexEnvi ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ) ; glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ) ; ! glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, ! GL_LINEAR_MIPMAP_LINEAR ) ; glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrapu ? GL_REPEAT : GL_CLAMP ) ; glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapv ? GL_REPEAT : GL_CLAMP ) ; #ifdef GL_VERSION_1_1 --- 464,470 ---- glTexEnvi ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ) ; glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ) ; ! glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, mipmap ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR ) ; glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrapu ? GL_REPEAT : GL_CLAMP ) ; glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapv ? GL_REPEAT : GL_CLAMP ) ; #ifdef GL_VERSION_1_1 *************** *** 535,540 **** --- 535,541 ---- char *filename ; int wrapu ; int wrapv ; + int mipmap ; int colour_material_mode ; sgVec4 specular_colour ; *************** *** 576,582 **** virtual void setTextureFilename ( char *fname ) ; virtual void setTexture ( char *fname, int _wrapu = TRUE, ! int _wrapv = TRUE ) ; virtual GLuint getTextureHandle (void) { --- 577,584 ---- virtual void setTextureFilename ( char *fname ) ; virtual void setTexture ( char *fname, int _wrapu = TRUE, ! int _wrapv = TRUE, ! int _mipmap = TRUE ) ; virtual GLuint getTextureHandle (void) { *************** *** 718,724 **** char *getTextureFilename(void) ; void setTextureFilename(char *fname) ; ! void setTexture ( char *fname, int _wrapu = TRUE, int _wrapv = TRUE ) ; GLuint getTextureHandle (void) ; void setTexture ( ssgTexture *tex ) ; --- 720,727 ---- char *getTextureFilename(void) ; void setTextureFilename(char *fname) ; ! void setTexture ( char *fname, int _wrapu = TRUE, int _wrapv = TRUE, ! int _mipmap = TRUE ) ; GLuint getTextureHandle (void) ; void setTexture ( ssgTexture *tex ) ; diff -cr plib-1.2.0/src/ssg/ssgSimpleState.cxx plib-1.2.0-new/src/ssg/ssgSimpleState.cxx *** plib-1.2.0/src/ssg/ssgSimpleState.cxx Fri Apr 28 00:51:06 2000 --- plib-1.2.0-new/src/ssg/ssgSimpleState.cxx Fri Aug 25 12:31:02 2000 *************** *** 439,448 **** } } ! void ssgSimpleState::setTexture ( char *fname, int _wrapu, int _wrapv ) { ! wrapu = _wrapu ; wrapv = _wrapv ; ! ssgTexture *tex = new ssgTexture ( fname, wrapu, wrapv ) ; setTexture ( tex ) ; delete tex ; } --- 439,449 ---- } } ! void ssgSimpleState::setTexture ( char *fname, int _wrapu, int _wrapv, ! int _mipmap ) { ! wrapu = _wrapu ; wrapv = _wrapv ; mipmap = _mipmap ; ! ssgTexture *tex = new ssgTexture ( fname, wrapu, wrapv, mipmap ) ; setTexture ( tex ) ; delete tex ; } diff -cr plib-1.2.0/src/ssg/ssgStateSelector.cxx plib-1.2.0-new/src/ssg/ssgStateSelector.cxx *** plib-1.2.0/src/ssg/ssgStateSelector.cxx Fri Apr 28 00:51:12 2000 --- plib-1.2.0-new/src/ssg/ssgStateSelector.cxx Fri Aug 25 12:32:52 2000 *************** *** 125,133 **** } ! void ssgStateSelector::setTexture ( char *fname, int _wrapu, int _wrapv ) { ! getCurrentStep()->setTexture ( fname, _wrapu, _wrapv ) ; } char *ssgStateSelector::getTextureFilename (void) --- 125,134 ---- } ! void ssgStateSelector::setTexture ( char *fname, int _wrapu, int _wrapv, ! int _mipmap ) { ! getCurrentStep()->setTexture ( fname, _wrapu, _wrapv, _mipmap ) ; } char *ssgStateSelector::getTextureFilename (void) Regards, Curt. -- Curtis Olson Human Factors Research Lab Flight Gear Project Twin Cities cu...@hf... cu...@fl... Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org |