Gl_texture_rectangle_ext - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Gl_texture_rectangle_ext (/thread-6352.html)
Gl_texture_rectangle_ext - nabobnick - Aug 10, 2004 06:50 AM
OK I had some code that would load in a texture and display it on a full screen quad, it was based off of the Apple Texture Range example and it would display correctly. Next I modified my code to load in a 3d object (including normals, and texture coordinates) and map this texture on to it. At this point no matter what I do was I able to get the texture to show up on the object correctly, instead of a texture I get what looks like might be a single shade of color (brownish green) which seems to be parts of the texture being mapped. Then on a whim I switched all occurences of GL_TEXTURE_RECTANGLE_EXT with GL_TEXTURE_2D and everything started working (well mostly, the texture coords may be a bit off) and I can now see the texture mapped to the object.
1.) Is there anything special you have to do when using GL_TEXTURE_RECTANGLE_EXT to get textures to show up?
2.) Why when I could see the texture mapped to a flat quad would it suddenly stop working when I begin to map it to multiple polygons?
If hardware matters I have a 17" iMac with a GeForce 4MX 64Mb.
Gl_texture_rectangle_ext - ThemsAllTook - Aug 10, 2004 07:02 AM
I remember hearing that texture coordinates for GL_TEXTURE_RECTANGLE_EXT are specified in pixels, as opposed to the homogenous coordinates for GL_TEXTURE_2D. I've never used GL_TEXTURE_RECTANGLE_EXT myself, though, so bear in mind this isn't first-hand information.
Gl_texture_rectangle_ext - arekkusu - Aug 10, 2004 07:25 AM
Quote:How are texture coordinates addressed for rectangular textures?
Seriously, RTFM. There is a lot of particular information you have to know before trying to use OpenGL, especially extensions.
Gl_texture_rectangle_ext - nabobnick - Aug 10, 2004 10:13 AM
Was using the Redbook for a guide although it does not mention GL_TEXTURE_RECTANGLE_EXT that I saw. Is there a better place for a noob to look up this kind of stuff so I won't have to bother you?
Thanks for the answer though that clears up why it looked like I was getting only about one pixel worth of the texture, I guess I need to multiply my texture coords by the width and height to get them to map correctly. Now that I think about it the Apple Texture Range example uses the width and height of the texture in the glTexCoord calls, I missed this because I assumed it was some state that I didn't enable or something.
Gl_texture_rectangle_ext - arekkusu - Aug 10, 2004 10:31 AM
You can multiply in either glTexCoord, or in the texture matrix.
For reference material, this book might be good.
Or the official online registry.
And there's my page which lists what extensions are available on each GPU under a few versions of OS X, as well as linking to the sgi, PC, and Apple registries.
And don't forget the official specs.
Gl_texture_rectangle_ext - nabobnick - Aug 10, 2004 10:38 AM
Thanks those will help alot. I always prefer to look things up but sometimes your not sure where to look.
Gl_texture_rectangle_ext - lightbringer - Aug 10, 2004 11:11 AM
My personal favorite way to look up information on extensions (besides google):
Delphi's OpenGL Hardware Registry
Click the name to see what cards support the extension, and click the spec link to view the spec for the extension. I use it all the time.
Gl_texture_rectangle_ext - arekkusu - Aug 10, 2004 11:16 AM
Yeah, that's the PC registry I link to. My page is an attempt to be Delphi, for Macs.
Gl_texture_rectangle_ext - lightbringer - Aug 10, 2004 11:17 AM
arekkusu Wrote:Yeah, that's the PC registry I link to. My page is an attempt to be Delphi, for Macs.
Ah, didn't notice that. Cool.