Thread: [PyOpenGL-Users] glTexImage2d size
Brought to you by:
mcfletch
From: Andrew W. <and...@al...> - 2006-11-13 18:46:43
|
Hello, I'm trying to load some textures that do not have width and height of 2n+2. It seems that this works great on some graphics cards and bombs on other cards. I know it is supposed to be 2n+2 but why would some cards let me do this and others not? And any suggestions on how to detect if the graphics card is compatible? Also any suggestions on efficient padding so that the images still co-register properly? Thanks Andrew |
From: Matt B. <ma...@rt...> - 2006-11-13 19:14:16
|
Hrrrmmm, OpenGL textures should always have dimensions that are a power of 2. Are you saying you want to use images that do not conform to this? This normally is not possible, I don't know of a way around it. If that's what you're trying to do, I'm surprised it works on any video card at all. -Matt Bailey On Monday 13 November 2006 13:46, Andrew Wilson set 1,000 monkies in front of keyboards and the following appeared: > Hello, > I'm trying to load some textures that do not have width and height of > 2n+2. It seems that this works great on some graphics cards and bombs on > other cards. I know it is supposed to be 2n+2 but why would some cards let > me do this and others not? And any suggestions on how to detect if the > graphics card is compatible? Also any suggestions on efficient padding so > that the images still co-register properly? > Thanks > Andrew |
From: red p. <red...@ya...> - 2006-11-13 19:21:25
|
I installed PyOpenGL and ctypes in my cygwin. But when I excute following command it said, >>> from Tkinter import Tk >>> from OpenGL.GL import * 6 [main] python2.4 2676 f:\cygwin\bin\python2.4.exe: *** fatal error - f:\cygwin\bin\python2.4.exe: *** unable to remap f:\cygwin\bin\tk84.dll to same address as parent(0x18E10000) != 0x18E20000 8 [main] python 1760 fork: child 2676 - died waiting for dll loading, errno 11 Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/OpenGL-3.0.0a4-py2.4.egg/OpenGL/GL/__init__.py", line 3, in ? from OpenGL.GL.simple import * File "/usr/lib/python2.4/site-packages/OpenGL-3.0.0a4-py2.4.egg/OpenGL/GL/simple.py", line 3, in ? from OpenGL import platform, arrays File "/usr/lib/python2.4/site-packages/OpenGL-3.0.0a4-py2.4.egg/OpenGL/platform/__init__.py", line 24, in ? from OpenGL.platform.glx import * File "/usr/lib/python2.4/site-packages/OpenGL-3.0.0a4-py2.4.egg/OpenGL/platform/glx.py", line 29, in ? mode=ctypes.RTLD_GLOBAL File "/usr/lib/python2.4/site-packages/OpenGL-3.0.0a4-py2.4.egg/OpenGL/platform/ctypesloader.py", line 30, in loadLibrary name = util.find_library( name ) File "ctypes/util.py", line 95, in find_library lib = _findLib_ld(name) or _findLib_gcc(name) File "ctypes/util.py", line 78, in _findLib_ld res = re.search(expr, os.popen('/sbin/ldconfig -p 2>/dev/null').read()) OSError: [Errno 11] Resource temporarily unavailable Anybody can tell me why and how to solve this problem Thank, John ____________________________________________________________________________________ Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com |
From: Mike C. F. <mcf...@vr...> - 2006-11-24 17:04:36
|
red puck wrote: > I installed PyOpenGL and ctypes in my cygwin. > I've never tried to run PyOpenGL under cygwin, so I'm somewhat at a loss here. It looks as though there's a problem with the library finding function in ctypes. It's possible we could just catch the OSError and try loading the bald function. It might work, but it's just as likely to wind up doing nothing at all. See platform/ctypesloader.py for the code that does the load. The use of the GLX platform seems like it might cause problems? But then I suppose you're using an X-windows server under cygwin, not mingw32 so GLX would make sense. Good luck, Mike ... > "/usr/lib/python2.4/site-packages/OpenGL-3.0.0a4-py2.4.egg/OpenGL/platform/glx.py", > line 29, in ? > mode=ctypes.RTLD_GLOBAL > File > "/usr/lib/python2.4/site-packages/OpenGL-3.0.0a4-py2.4.egg/OpenGL/platform/ctypesloader.py", > line 30, in loadLibrary > name = util.find_library( name ) > File "ctypes/util.py", line 95, in find_library > lib = _findLib_ld(name) or _findLib_gcc(name) > File "ctypes/util.py", line 78, in _findLib_ld > res = re.search(expr, os.popen('/sbin/ldconfig -p > 2>/dev/null').read()) > OSError: [Errno 11] Resource temporarily unavailable > ... -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Andrew W. <and...@al...> - 2006-11-13 19:26:31
|
Hello, You are correct, I would like to use textures that are not of power 2 in dimension. I have an Nvidia Quadro FX 3450 that mysteriously supports it. I seem to have found a work around using the gluBuild2DMipmaps call, the appear to automatically pad the image correctly. I guess I should read the documentation a little closer! Thanks Andrew On 11/13/06, Matt Bailey <ma...@rt...> wrote: > > Hrrrmmm, OpenGL textures should always have dimensions that are a power of > 2. > Are you saying you want to use images that do not conform to this? This > normally is not possible, I don't know of a way around it. If that's what > you're trying to do, I'm surprised it works on any video card at all. > > -Matt Bailey > > On Monday 13 November 2006 13:46, Andrew Wilson set 1,000 monkies in front > of > keyboards and the following appeared: > > Hello, > > I'm trying to load some textures that do not have width and height of > > 2n+2. It seems that this works great on some graphics cards and bombs > on > > other cards. I know it is supposed to be 2n+2 but why would some cards > let > > me do this and others not? And any suggestions on how to detect if the > > graphics card is compatible? Also any suggestions on efficient padding > so > > that the images still co-register properly? > > Thanks > > Andrew > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > |
From: Matt B. <ma...@rt...> - 2006-11-13 20:27:14
|
Oh, cool, I didn't know about that function, might have to check that out. In my current game I'm just making them all a power of 2, which works well enough for most things (I like having the extra space to work with in the image just in case I or someone else chooses to edit the look of things a bit later on), but to save disk space/memory I re-sized my player's weapon images some to make them a power of 2, and then expand the OpenGL surface out to the aspect ratio of the "correct" original gun image....since I'm downsizing the image in one dimension, I lose some detail. -Matt Bailey On Monday 13 November 2006 14:26, Andrew Wilson set 1,000 monkies in front of keyboards and the following appeared: > Hello, > You are correct, I would like to use textures that are not of power 2 in > dimension. I have an Nvidia Quadro FX 3450 that mysteriously supports it. > I seem to have found a work around using the gluBuild2DMipmaps call, the > appear to automatically pad the image correctly. I guess I should read the > documentation a little closer! > Thanks > Andrew > > On 11/13/06, Matt Bailey <ma...@rt...> wrote: > > Hrrrmmm, OpenGL textures should always have dimensions that are a power > > of 2. > > Are you saying you want to use images that do not conform to this? This > > normally is not possible, I don't know of a way around it. If that's what > > you're trying to do, I'm surprised it works on any video card at all. > > > > -Matt Bailey |
From: JoN <jo...@we...> - 2006-11-13 23:10:28
|
Hi guys, AFAIK the ability to support non-power-of-2 (NPO2 or NPOT) textures is a card-specific thing, and hence their OpenGL driver thing. I _think_ NPO2 texture support is supposed to be a standard feature of Op= enGL 2.X, but I don't think all cards support it. Jon Quoting Matt Bailey <ma...@rt...>: > Oh, cool, I didn't know about that function, might have to check that o= ut. In >=20 > my current game I'm just making them all a power of 2, which works well= =20 > enough for most things (I like having the extra space to work with in t= he=20 > image just in case I or someone else chooses to edit the look of things= a bit >=20 > later on), but to save disk space/memory I re-sized my player's weapon = images >=20 > some to make them a power of 2, and then expand the OpenGL surface out = to the >=20 > aspect ratio of the "correct" original gun image....since I'm downsizin= g the >=20 > image in one dimension, I lose some detail. >=20 > -Matt Bailey >=20 > On Monday 13 November 2006 14:26, Andrew Wilson set 1,000 monkies in fr= ont of >=20 > keyboards and the following appeared: > > Hello, > > You are correct, I would like to use textures that are not of power= 2 in > > dimension. I have an Nvidia Quadro FX 3450 that mysteriously support= s it. > > I seem to have found a work around using the gluBuild2DMipmaps call, = the > > appear to automatically pad the image correctly. I guess I should re= ad > the > > documentation a little closer! > > Thanks > > Andrew > > > > On 11/13/06, Matt Bailey <ma...@rt...> wrote: > > > Hrrrmmm, OpenGL textures should always have dimensions that are a p= ower > > > of 2. > > > Are you saying you want to use images that do not conform to this? = This > > > normally is not possible, I don't know of a way around it. If that'= s > what > > > you're trying to do, I'm surprised it works on any video card at al= l. > > > > > > -Matt Bailey >=20 >=20 > -----------------------------------------------------------------------= -- > Using Tomcat but need to do more? Need to support web services, securit= y? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geron= imo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users >=20 -------------------------------------------------------------------- Come and visit Web Prophets Website at http://www.webprophets.net.au |