PDA

View Full Version : Doing backdrops



NordFenris
02-12-2003, 11:37 AM
I don't know if this is considered 'advanced' enough, but feel free to flame me. http://www.opengl.org/discussion_boards/ubb/smile.gif

I'm writing a pretty simple puzzle game, but as this issue will come up in my further development, I need to get some input on it as early as possible.

I need to put a backdrop behind my game as a texture. I'll resolve this through a window-sized quad, with appropriate texture coordinates. This introduces some issues:

The window is of a non-"texture" size (i.e. 2-order square - as the game needs to run without rectangular texture extensions), so I stand between employing and stretching a 512x512 texture to 700x500 window size, and using a 1024x1024 texture and use lesser texture coordinates to fit. Now, whichever is faster? (I know I could test this right off, but I would like to know your opinion, and there's an other issue related) To stretch that window-sized texture or do a ridiculously large texture upload per frame? Is texture stretching slow, if I also need high quality filtering? I know that there's extensions to do quick texture uploads on the Mac (on which I'm writing this game), what about WGL extensions? (It's also being ported to Windows) Any kewl buzzw0rdz I could throw at the Win programmer?

If I throw this quad up, what will I benefit from doing it in a display list? Any chances for the texture to go into cache? And, for querying texture memory size, I tried glGetDoublev (GL_MAX_TEXTURE_SIZE, &texSize), which clearly didn't work. Where did I go wrong?

But wait, there's more to this newbie topic! http://www.opengl.org/discussion_boards/ubb/smile.gif Since I'll redraw just a small portion of the screen each frame, is there a way to restrict redraws to just a specific rect of the screen? Will glScissor do this for me, if I don't clear the buffers? (well, two small portions, but I guess there's no way to set up two scissor boxes?) And way more important, is this what glScissor does?

Is there a better way to do this back-drop thingie? I actually hoped this would be quicker and less painful for the video board than dropping a huge texture onto it and blowing the fill rate to hell. :p

Well, thanks for your time, and if this is to neophytic, then please tell me so.

Mazy
02-12-2003, 12:55 PM
Use a 1024*512 texture.. less memory footprint and pixelexact result.

NordFenris
02-12-2003, 01:02 PM
Of course. http://www.opengl.org/discussion_boards/ubb/smile.gif Why didn't I think of that?

Although, wouldn't this cause more distortion - both MIN and MAX filtering?