Texture swapping

Started by
1 comment, last by lc_overlord 18 years, 9 months ago
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?
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.

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.

This topic is closed to new replies.

Advertisement