Jump to content
  • Advertisement
Sign in to follow this  
Sirisian

OpenGL Binding a texture performance question.

This topic is 4325 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

I've been using OpenGL for a while and I never put much thought into if I'm doing things right. In the FAQ it lists binding a texture as the second highest GPU state change. I have usually put all my images of likeness into a specific .png and never worried about state changes. Like I'd render a bunch of bullets and never rebind a texture. With my new game it's rather dynamic and I can't put things onto a grouped texture. How do you guys handle having to rebind textures to render say animations and textures for very distinct objects in a game while reducing the need to rebind. I figure for each animation I can combine the animations into animation like sheets. However it hit me that each object is usually different and the type of object might not be on the multiple times so as I iterate through my objects to render I am continually forced to rebind different textures. I've ended up even encapsulating the render function into my game objects since the textures are so different. Am I missing a huge idea or something, or am I overreacting? Like if I rebind the texture for like 100 projectiles on the screen that all look different and tons of different architecture type things and objects animation textures. :) (my game is 2d if that helps) I'd like any advice or if I am in fact overreacting someone tell me. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Handling a minimal number of sheets is indeed less strain on the graphics subsystem. I've done the same, so I say: Rock on. (Also, I wouldn't call easy optimization like this over-reacting :D)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!