Dear Opengl Programmers,

When to use GL_TEXTURE_RECTANGLE_NV and How different it is from GL_TEXTURE_2D.

(I am still using opengl 1.2 (red book).
I am slowly shifting higher versions
I have never programmed using ARB extensions and GLSL.)

Thanks in advance

The main difference are texture coordinates. The usual textures accept coordinates in range [0…1, 0…1], where rectangle textures are [0…w, 0…h] - w is width, h is height. Basically you use then just like usual textures, but instead of using the GL_TEXTURE_2D texture target, you use GL_TEXTURE_RECTANGLE_NV (upload data with glTexImage2D, enable the texture etc.) Don’t forget that rectangle textures have no mipmaps! Forr deeper understanding, refer to the extensions specs.

P.S. You should post questions like this in beginners forum.

The other difference is that in OpenGL <= 1.5, you can only use texture sizes that are a power of two with GL_TEXTURE_2D, while with RECT it does not matter.

Starting with OpenGL 2.0, this restriction no longer exists, so today RECTANGLE textures are not so important anymore. If I were you, I’d totally skip this extension and go straight for OpenGL 2.0.

… the 2 are spelled differently …

Iris, if you don’t mind my asking, what field of science are you in?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.