Yet another basic OpenGL question

Mikuro

Crotchety UI Nitpicker
Basic problem: I can't figure out how to display images that are bigger than 256x256 pixels in a way that looks seamless.

Pseudo-solution: Since OpenGL textures cannot be larger than 256 pixels wide or high, I split my larger textures into multiple textures and apply them to side-by-side quads. Fair enough. A bit of a pain, but I rewrote my program to do it. It looks fine....except when transformations are applied.

More specific problem: If I rotate my group of quads, I get seams between the different pieces (see attached image).

At first I thought "Oh! I need to use the border when creating my texture! I remember reading about that!" So I rewrote my program to do that, but it didn't change anything. :(

Strangely, the problem only seems to occur when I use GL_LINEAR as my scaling filter. If I set it to GL_NEAREST, there are no seams; of course, the whole image looks much worse that way, so this is not a satisfying solution. (My main test is drawing the image at 1/4th normal size, but the seams are present at full size with linear scaling, too.)


Any tips? I assume this is a pretty common problem with a common workaround (I've certainly heard enough people mention the problem in my searches, but I haven't found any specifics on solutions), so I hope my code isn't necessary. If it is, I can post whatever might be relevant.
 

Attachments

  • seams.png
    seams.png
    6.7 KB · Views: 12
........Looks like I just found the solution on my own. All this dancing and prancing with 256-pixel chunks was stupid. All this time I could have been using GL_TEXTURE_RECTANGLE_EXT instead of GL_TEXTURE_2D. GL_TEXTURE_RECTANGLE_EXT has no size limitations of any kind, apparently. It's like a dream....

I really, really need to get up-to-date learning materials. I just picked this up on some forums while searching with Google.

Is there any downside to GL_TEXTURE_RECTANGLE_EXT? Or is GL_TEXTURE_2D essentially obsolete?

And if anyone can point me to some good reference material regarding this, that'd be awesome. My Red Book and Blue Book make no mention of GL_TEXTURE_RECTANGLE_EXT at all. Do the current versions cover it?
 
Mikuro said:
........Looks like I just found the solution on my own. All this dancing and prancing with 256-pixel chunks was stupid. All this time I could have been using GL_TEXTURE_RECTANGLE_EXT instead of GL_TEXTURE_2D. GL_TEXTURE_RECTANGLE_EXT has no size limitations of any kind, apparently. It's like a dream....

I really, really need to get up-to-date learning materials. I just picked this up on some forums while searching with Google.

Is there any downside to GL_TEXTURE_RECTANGLE_EXT? Or is GL_TEXTURE_2D essentially obsolete?

And if anyone can point me to some good reference material regarding this, that'd be awesome. My Red Book and Blue Book make no mention of GL_TEXTURE_RECTANGLE_EXT at all. Do the current versions cover it?

Glad you found a solution, I was about to say that there has to be a way to use larger textures because I had seen them used before.

As far as learning materials goes, one of my friends has done quite a lot with OpenGl and Java (using LWGL) and almost everything he has learned came from game dev forums. There is a ton of free useful information out there... the only problem is you have to sift through all the "I want to make a game, show me how" posts :-D
 
I've found a bit more info online now. http://web2.airmail.net/sjbaker1/tiling_textures.html explains the general hopelessness of getting such a thing to work well with 256-pixel tiles (it IS possible....but not really). What a MESS.

I've also heard that GL_TEXTURE_RECTANGLE_EXT is not supported on older Macs. Apparently the Rage 128 Pro doesn't support it. That's what my old iMac had, and now I'm thinking that might be why certain OpenGL programs just Didn't Work™ for me back then. The hardware requirements of OpenGL are steep enough as it is. Do I really want to give the proverbial finger to even more users? *sigh* This really sours me on the whole idea of using OpenGL.

I miss QuickDraw. Yes, really.
 
Back
Top