Archived

This topic is now archived and is closed to further replies.

wall

Best way to draw backgrounds

Recommended Posts

Hi! I wonder what you guys think is the best way to draw a background using OpenGL. When I say background I mean an image that covers the whole screen behind the other objects. Cutting the image into 256*256 textures and mapping them onto a grid of quads is one way, but is there an easier or faster way? Thanks!

Share this post


Link to post
Share on other sites
1. Load the background texture
2. Bind the texture
3. Disable Depth Testing
4. Render a quad, the size of the window
5. Enable Depth Testing
6. Render all your other objects...

Share this post


Link to post
Share on other sites
Yeah, but that''ll give pretty crappy quality since you can''t have textures that are like 1024*768, right?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
In terms of overdraw, would it not be better to draw the background after everything else is drawn? Ok, assuming you have nothing that needs to blend with the background.

Share this post


Link to post
Share on other sites
It will probably be better to draw it after everything else, but it would make little, if any, difference...

You can probably use a 512x512 texture, and it would look alright... And it definitely won''t look better, or be faster, if you cut it up into several smaller quads... But it will look good enough if you use a good texture filter

Share this post


Link to post
Share on other sites