Jump to content
  • Advertisement
Sign in to follow this  
zypo

Texture swapping

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

everytime i call glBindTexture(), does it copy video memory all over the place? in other words, is the function slow when used many times/frame?

Share this post


Link to post
Share on other sites
Advertisement
I can't give you the exact details on how it works because A) That info is very implementation specific and B) I don't work for anyone who makes OpenGL implementations.

However, I CAN tell you that typically texture state changes are staggeringly slow indeed, one of the slowest returning functions in openGL. So yes, glBindTexture2D() is typically very slow (compared to the other gl functions). The solution to this is to keep your texture calls to a minimum by sorting your primitives by texture used. and then draw them in that order, switching textures only when neccesary.

Share this post


Link to post
Share on other sites
Quote:
Original post by zypo
everytime i call glBindTexture(), does it copy video memory all over the place?
in other words, is the function slow when used many times/frame?


no it doesn't copy video memory all over the place all the time, unless you did something bad that is.

and yes it's a major slowdown (not glBindTexture()specificly, but the statechange preceding the geometry part), so try to render all polygons in a scene that uses that texture in one go.
Allso try merging many small textures into one larger one.

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!