ATI equivalent of TEXTURE_RECTANGLE

Hey all,

I would like to declare a pbuffer that is not of size 2^n by 2^n on a Radeon 9700. On nvidia hardware i would use the TEXTURE_RECTANGLE_NV extension, but i can’t fins an equivalent one for ATI. Does anyone have any pointers as to the extension to use, or anything else that can help me.

Thanks

EXT_texture_rectangle. I’ve used that on Radeon 8500. I’m sure it’ll appear on NV hardware too.

A link to the spec,
http://developer.apple.com/opengl/extensions/ext_texture_rectangle.html

Since Mark Kilgard is the contact person, it’ll definitely appear on NV hardware ( if not already there ).

Edit:
I just checked the #define’s are identicle to the NV version.

[This message has been edited by PH (edited 10-13-2002).]

Hmm … checking glATi.h on ATi’s site I found this:

#define GL_TEXTURE_RECTANGLE_EXT 0x85B3
#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x85B4
#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x85B5
#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x85B6

Your link shows
TEXTURE_RECTANGLE_EXT 0x84F5
TEXTURE_BINDING_RECTANGLE_EXT 0x84F6
PROXY_TEXTURE_RECTANGLE_EXT 0x84F7
MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8

which is the same as in the NV extension. I haven’t used any of them so I don’t know, but I found this out when I saw the EXT version in the extension string of my 8500, and I though that the EXT was a new one which maybe relaxed some of the restrictions of the NV version. Looking at that apple page though it seams that the spec looks very legit and isn’t just a cut’n’paste from the NV spec, so I guess it’s just a error in the wglATi.h.

Strange. You’re right, they don’t match ( the NV and EXT versions should be equivalent according to the apple spec ). There’s a version of the spec on ATIs site here,
http://www.ati.com/developer/proginfo.html
The pdf a bit down the page: “ATI OpenGL Supported Extension List”.

So, it seems they are not entirely identicle !? Well, the EXT constants work at least .

Hmm, the apple spec has a newer date!!

Note, I tried the EXT version some time ago ( before it was in the extension string ), so it might have changed since then ( looks like it )… I’ll have to try it out again.

Ok, the NV constants are the ones that are valid now. It works as expected on the 8500 but it messes up my font ( I’ll have to checl if this is my bug ).

Edit:

Looks like there’s a bug in glCopyTexSubImage2D with texture_rectangle on 8500. The copy is fine but it apparently writes into other textures memory.

[This message has been edited by PH (edited 10-13-2002).]

How would i go about using it for the declaration of the pbuffer though?

Currently i choose the attributes as follows:

// set some pbuffer attributes so that we can use this pbuffer as a
// 2D RGBA texture target
int pAttrib[] =
{
WGL_TEXTURE_FORMAT_ARB,
WGL_TEXTURE_RGBA_ARB,
WGL_TEXTURE_TARGET_ARB,
WGL_TEXTURE_2D_ARB,
0
};

// create the pbuffer
hPBuffer = wglCreatePbufferARB(hGLDC, pixelFormat, width, height, pAttrib);

if(!hPBuffer)
{
printError(“P-buffer Error: Unable to create P-buffer”);
}

The problem is that as expected the call will fail if width and height are not powers of two. How would i use TEXTURE_RECTANGLE_EXT instead?

This is to supplement my last post.

I can’t find a WGL_TEXTURE_RECTANGLE_EXT or anything similar in the header files from ATI, whereas the nvidia header files does have this.

Thanks

I was recently looking for a solution for this. The solution I came up with was to simply make my pbuffer the next power of 2 greater than what I needed and use glViewport() to render only small region of the pbuffer.

Example:

wglCreatePbufferARB(blah, blah, 1024, 512, blah);

wglMakeCurrent(blah, blah);
glViewport(0, 0, 640, 480);

Anyways, works like a charm. I suspect the various RECTANGLE extensions basically do the same thing under the hood. Anyways, I found really no good solution online so I thought I would share mine.

In ATI Catalyst 4.12 beta there is an extension called WGL_ATI_render_texture_rectangle. But there is no documentation about it. I’m sure it’s just a constant, like WGL_TEXTURE_RECTANGLE_NV. I havn’t tried it though…