Jump to content
  • Advertisement

Archived

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

wall

Best way to draw backgrounds

This topic is 5534 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!