Skip to main content
GameDev.net gamedev.net
🔒 Locked

Generic Rectangular Texture Support

Started by DIB Jan 22, 2007 at 2:49 PM 5 replies 1.4k views
Original Post
DIB
DIB
I am writing some software that I am using rectangular textures in. It works fine on many cards, but not on others. What is the best way to use rectangular textures and to check to see if a card supports them? Currently, I check to see if "GL_ARB_texture_rectangle" is supported. If it is not, then I assume the card cannod use "GL_TEXTURE_RECTANGLE_ARB". I use GL_TEXTURE_RECTANGLE_ARB as my texture target. Should I be checking for the "GL_NV_texture_rectangle" and "GL_EXT_texture_rectangle" as well? Should I be using another texture target instead of GL_TEXTURE_RECTANGLE_ARB that is more widely supported? Thanks.
Yonibear
Yonibear
You should check for all three extensions and use rectangle textures if you find one of them.
If you look into your glext.h, you see that the extension define their constants with exactly the same numbers, so you can use any extension if you found one of them.
DIB
DIB
I saw that GL_TEXTURE_RECTANGLE_ARB was defined the same as the NV and EXT versions, but I wasn't sure that there wasn't an even more standard way of doing this. Just wanted to make sure since I don't always stay current with this stuff.

I appreciate the input!
Int19
Int19
I will be doing a bunch of this stuff next week, so i dont have all the facts yet. But looking at this here computer (ATI x1950) it reports ARB_texture_rectangle support but no ARB_texture_non_power_of_two support.

Since i dont like writing different shaders for a stupid thing like renormalizing UV coords i just went ahead and uploaded a non pow2 texture as a regular TEXTURE_2D target and it works just fine. I do remember some old (really OLD) article talking about how NPT textures work in opengl as long as mipmapping is enabled. Havnt verified this, but it would be great if you could :)
_the_phantom_
_the_phantom_
If the driver reports GL version 2.x then you have support for non-power-two textures regardless of the extension.

However, on ATI hardware if you don't find the ARB_texture_non_power_of_two then you can't use mipmaping on the texture unit without it slowing to software speeds.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.