Thread: Re: [Plib-devel] texture repeating (Page 3)
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 |
From: Steve B. <sjb...@ai...> - 2000-08-22 03:20:25
|
"Curtis L. Olson" wrote: > Let's see if I understand ... > > I am (by definition) not tweaking any states that ssg normally would > manage. Indeed. > But, since these states are grouped, and doing a > glPushAttribute() saves a whole slew of states, I may unwittingly > alter a state that ssg *does* manage as a side effect of my > glPopAttribute() Yes - by accidentally restoring it to the state BEFORE the most recent state->apply. > I'll give it a try in my sky code ... > > Here's what I get now: > > no matching function for call to `ssgEntity::hasState ()' > no matching function for call to `ssgEntity::getState ()' Doh! These are only members of ssgLeaf - general purpose entities don't have states unless they happen to be leaf nodes. > A check of ssg.h indicates that these are indeed not members of > ssgEntity. Yep. > But, the compiler lets me get away with this ... sound reasonable? > > ssgLeaf *f = (ssgLeaf *)e; > if ( f -> hasState () ) f->getState()->apply() ; Yep - so long as you only attach this callback to a leaf node. If you were playing it super-safe you could do an 'isAKindOf' test to check before you did the cast. > I'll play around with this some more. I'm still having a touch of bad > luck with GL_DEPTH_TEST, but I'm forcing this in other places in my > code too. Could be that I'm entering the code with it off and since > the sky code is actually preserving the state rather than turning it > [back] on when it is done, I could be exiting they sky rendering > section with the state set different now. Urrrggggg ... brainnn ... can't ... quite .... reach ... Hold on - it's coming <rumble> - yes - comprehension is dawning <creak> <rattle> <rattle> *POP* Yes. By doing this "right" you could actually be cancelling out one half of an elegant matched pair of antique Colonial bugs...which erm...greatly reduces their value. Hmmm - so this might mean that my explanation is not the right one (although it's still "TRUE" and must still be attended to). -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net |
From: Sam S. <sa...@sp...> - 2000-08-10 20:33:48
|
----- Original Message ----- From: "Steve Baker" <sjb...@ai...> To: "PLIB-devel" <pli...@li...> Sent: Wednesday, August 09, 2000 9:54 PM Subject: [Plib-devel] Work outstanding. > * Sam Stickland posted a patch to allow PUI menu's to be resized. I havn't > had time to deal with that (sorry Sam)...but since he now has CVS access, I > guess he can do it himself now. I added this change now - I'll document it tomorrow. Sam |