Drawing a simple static background image

Started by elias4444, September 26, 2005, 20:37:42

Previous topic - Next topic

elias4444

I want to simply draw a large background image behind everything (something like a nice scenic picture or a snapshot from the game for a menu backdrop). What's the most efficient way to do this? I've thought of the following, but if someone else has a better idea, please let me know:

1. Take a LARGE image (like 1024x1024 pixels or higher) and texture map it to a large rectangle set behind everything.

or

2. Use the GL11 glBitMap function (which I've never used)

or

3. Something better.  :)

Any ideas/help is appreciated.
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Fool Running

I think the fastest way (i.e. the best  :lol: ) is to do #1.
I think every time you call glBitMap() it transfers the bitmap to the graphics card (someone can correct me) which is slow.
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

elias4444

I've been doing some benchmarking, and the texturemap is definitely faster... I'm just worried about using such a large texture.  :?
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Matzon

anything above 512 will break on matrox

CaseyB

I've been doing some benchmarking as well with displaying images in OpenGL vs. Java2D and it appears that Java2D is actaully faster!  I can't image why that would be!  It seems to me that Java2D would have the image in main memory and have to transfer that to the video card as in the glBitMap() case so OpenGL should (in the worst case) be as fast as Java2D, but in my tests it's not!

tomb

Java2D uses HW acceleration if you follow some strict rules, or enable non-default pipelines. In wich case it's the same as rendering a texture in OpenGL. Should be roughly the same speed.

WiESi

Quote1. Take a LARGE image (like 1024x1024 pixels or higher) and texture map it to a large rectangle set behind everything.

I would recommend you to use GL_TEXTURE_RECTANGLE_ARB or GL_TEXTURE_RECTANGLE_EXT or GL_TEXTURE_RECTANGLE_NV because it uses less memory and you can choose the size of the image at your own... and it looks better. Maybe using compressed textures would still use less memory but I don't have any experience with that stuff.

WiESi

oNyx

Quote from: "Matzon"anything above 512 will break on matrox

Anything above 256 will break on voodoo :D

Well, there are like a dozen ways to do this. If its say... 1024x768, I would use a 1024x512 texture and a single quad. Or a 1024x512 and a 1024x256 texture and two quads.

Or you could use a 4x3 grid with 256x256 textures. Or a 2x1 grid with 512x512 and a 2x1 grid with 512x256.