   Multitexturing
  Ive just taken up multitexturing for terrain rendering. But I suspect I either dont understand what multitexturing is or is for...or how to use it.Basically I wanted to use it as a way to avoid slow glBindTexture calls. By loading multiple textures in and then switching between them by varying the index on the texture cords function.Looking at Nehe 22 it seems multi-textuing is perhaps for something a bit more complicated and clever than what Im trying to do.So my question first is: Am i barking up the wrong tree? Or is this indeed a way to speed up terrain rendering?Now the problem.I wrote a test program to get it going. The program currently (each frame) loads two textures in and displays either 0 or 1. This can be toggled by a key press.All works great except if the first texture co-ordinate on the Y axis is not zero (or 1.0 2.0 etc)If the co-ordinate is fractional.....then each successive key press causes textures to change and go missing.Ill post code if needed...was hoping someone might know what Ive done wrong.Does multi-texturing not allow fractional co-ordinates?Thanks for any help you can give.   
  Multitexturing is for blending 2 or more textures. example:http://www.lighthouse3d.com/opengl/glsl/index.php?textureMulti;  are you actually running into bottlenecks with too many texture switches? are you sorting your meshes to minimize these state changes?maybe your world simply needs to reuse textures more often. atlasing textures together can help this to an extent;Quote:Original post by RDragon1are you actually running into bottlenecks with too many texture switches? are you sorting your meshes to minimize these state changes?Im anticipating a problem. The terrain doesn't support different textures yet (most of the code is in but not the switching part). However inserting a bind command to be done before each tile is very slow.Because the draw distance is ~10 miles Im sorting them by distance.Of course, thats a worse case scenario and the #switches will be far less in reality. Was hoping to speed it up by 'caching' the textures in the mutitexture units.Quote:maybe your world simply needs to reuse textures more often. atlasing textures together can help this to an extentIll look up atlasing. Thank you. EDIT. Oh right, I considered doing that...but it requires the textures be aligned to the mesh and I wanted to be able to make use of texture wrapping. However, perhaps Ill reconsider and work on making hem aligned.Quote:Multitexturing is for blending 2 or more textures. example:http://www.lighthouse3d.com/opengl/glsl/index.php?textureMultiSo no good for what Im trying to do then? Like I said, it did work and much faster...so long as I dont use a fractional co-ordinate on the Y axis.Thanks for the replies.[Edited by - empirical2 on June 25, 2009 6:07:54 AM]