problem with glTexImage2D and texture border : not textured

Hi,

I’ve been trying for a couple of hours to remove filtering artifacts at the junction of two adjacent textures (on adjacent quads)
I finally got down to try specifying a border of 1 in the glTexImage2d call.

First, I got a buffer size exception due to the fact that I was passing 2^n + 2 as a width (same for height) along with a border of 1. Apparently I must specify image size without is borders, that is 2^n (can someone confirm please ?)

But then, although it did not crash, my texture did not make it to the screen, i.e. they are black (the current color of my gl context). Texturing does no work in this case, as if I had specified non power of two textures (which are not supported by my crappy “professional” Quadro video board…)

Could anyone bring me some advice ?

Thanks a lot

Yes, the image size is without the border.

Do things work if you leave out the border? Have you set up all of the minification and magnification filter states?

Yes, it works without the border. All filters are set (to linear).
I tested the very same code on a higher end (still Nvidia) video card, and it works.
On another radeon 9000 mobility, it did not.
Should I conclude that this border function is not supported by lower end boards ?

If things work without the texture border then I’d come to the same conclusion. This was functionality introduced on old high-end SGI hardware and I’m not sure whether it made it into many of the PC-grade cards. You can get a similar effect by adjusting your texture coordinates to make the four corners end up in the middle of the edge texels rather than on the edge. The Grand Canyon demo does this; you can download and look at the source code for a hint on how to do this.

Thanks Ken.

I managed to get around this problem by making something I had done befor work, which is more or less what you mentionned I guess (texture represents a slighlty wider area, overlapping the adjacent one, and tex coords stops at (1.0 - 1/(2 * textureWidth)).

Anyway, I encounter the same problem with normals now, when using smooth shading, for adjacent meshes. Any known workaround for this one ?

(Thanks a lot for your time, I really appreciate)

To the best of my knowledge if you have a seam between two meshes and compute the normals correctly per vertex then there should be no visible seam between the meshes. Keep in mind that such a seam actually occurs between any two triangles or other primitives in your mesh and the reason it isn’t visible is that the per-vertex normals are being computed appropriately.