How safe it is to use GL_ARB_texture_rectangle

According to http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_rectangle.txt

the former extension “GL_EXT_texture_rectangle” became an official ARB extension in summer 2004: “GL_ARB_texture_rectangle”.

Please also see
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1110639195

Nvidia drivers support the GL_ARB_texture_rectangle extension, Ati drivers support the older but technically equivalent GL_EXT_texture_rectangle extension, to name two of the biggest 3d card vendors.

How safe is it to use this extension extensively in a 2d OpenGL game, which is targeted at computers with a minimum of 64 MB texture memory? Are there any numbers to see how many older PCs/Macs/Workstation :wink: you’re going to upset?

All of the texture_rectangle extensions (ARB, EXT, NV) define the same constants, with the same values. If any of the above is present, you can use rectangle textures.

That means, you can use it on:

ATI Radeon 7000 or better
NVIDIA GeForce 1 or better

Given your minimum, I’d say you’re ok.

The linked OpenGL extension registry says:

[quote]4) Should anything be said about performance?
No, but developers should not be surprised if conventional POTS textures will render slightly faster than texture rectangle textures. This is particularly likely to be true when texture rectangle textures are minified leading to texture cache thrashing due to lack of support for mipmaps.
[/quote]
Anybody with experiences on this?
What magnitude is “render slightly faster” ?

[quote]All of the texture_rectangle extensions (ARB, EXT, NV) define the same constants, with the same values. If any of the above is present, you can use rectangle textures.

That means, you can use it on:

ATI Radeon 7000 or better
NVIDIA GeForce 1 or better

Given your minimum, I’d say you’re ok.
[/quote]
Sounds very good.
Thanks for your suggestion.

One final question, though: compression of rectangle textures.
Paragraph “9) Can compressed texture images be specified for a rectangular texture?” says something about it.
I’m not sure if I fully undersand it, though. Can I still use
gl.glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA, …)
as I did for power-of-two textures (provided the card supports the extension “GL_ARB_texture_compression”) ?

Is it “just” that you can’t use glCompressedTexImage ?

[quote]Anybody with experiences on this?
What magnitude is “render slightly faster” ?
[/quote]
I would not expect much difference, but it generally depends. For example, I recently read that ATI does not support unnormalized texture coordinates, so they have to add, behind the scenes, the proper instructions in a fragment shader to normalize the texcoords. Another possibility is that the texture gets resized to the next POT dimensions (you lose memory of course) and then texcoords get treated accordingly.

But rectangle textures may be faster in other cases. One example is render-to-texture. Because render-to-texture works better with unswizzled formats and rectangle textures are generally stored that way, it actually renders faster. I have verified this in Marathon.

[quote]I’m not sure if I fully undersand it, though. Can I still use
gl.glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA, …)
as I did for power-of-two textures (provided the card supports the extension “GL_ARB_texture_compression”) ?

Is it “just” that you can’t use glCompressedTexImage ?
[/quote]
I haven’t tried it but, if I read correctly, I think you may use GL_COMPRESSED_X in glTexImage, but most probably you won’t get any compression (you should try though).

Thanks for your reply! I’m going to do some tests on the rectangle extension with compression.
However, if internally NPOT textures would be expanded to POT dimensions, this would kill my intended benefts and explode my VRAM usage… Because I use very many 2d texture sprites. So long I put the small sprites into large texture pages. However handling them is very awkward, especially when it comes to animations of large hierarchical 2d sprites.

I’m going to have to study if NPOT textures are expanded by some drivers/cards…