Fast Texture Switching

I want to do fast texture switching. What I mean is this:
Lets say I’ve got 2 textures (256x256). One for the floor, and one for the walls. When I’m rendering I’m switching between those 2 textures all the time using glBindTexture().
Is it smart to switch all the time, or is it faster to use one rendering pass for the floor, and one for the walls? Two rendering passes also call for more processor time.

In other words:

  • Is switching textures using glBindTexture() very slow?
  • Does it make much difference hardware/software rendering?

I wouldn’t say “very” slow, but it has a measurable cost, and it’s above-average as state changes go in terms of the size of its effects.

You have three options, as I see it:

  • Don’t sort.
  • Sort by texture.
  • Sort front to back.

Each has advantages and disadvantages…

  • Matt

i can imagine there will there be more effort to speedup texture swapping.
cause i can see programs wanting more + more texture variation in.
eg take quake2 here u bind a texture + draw a 500 tri model, and also any other models that require this texture.
in quake3 (exaggerated case) to draw the a model first u need to bind the shaders texture for the feet (20 tris) draw that mesh then bind another shader and redraw again.

Ahh yes, its the old case of offsetting flexiblity for raw speed…