   Render large tile grid
  Hey all,I'm trying to efficiently render a large amount of tiles in a grid, currently each tile consists of a colored background quad and another texture modulate quad on top.It's drawing using two calls to glDrawArrays (vertex arrays), once for the colored background and again for the upper textured layer. This doesn't seem very efficient and I'm sure it could be done better.What would be the best method for drawing tiles like this.ThanksDraconis   
  I guess you only draw the tiles that are visible (on screen).And you could render it to a texture, and only update the texture, if you zoom /pan the view. Panning requires updating only a fraction of the image. If a tile changes, you could only update that portion of the offscreen texture.I hope that makes sense.   ;  It's only rendering onscreen tiles, and I had thought about render to texture. I'll give that a go.Would a multitexturing or a shader be suitable for what I want?   ;  Theres really no reason you should need to have to draw the primitives twice. If I'm understanding right you have one "color" and one "texture", and you'd just like to combine them together to make a "colored texture" output?Or do you really have two textures?If its the former, I think you can use glTexEnvf to modulate the texture and the primitive color, but I don't know how much control it gives you over the blending factors.If its two textures then you could also use some kind of multitexturing extension as well.The best option is to just use a custom shader, you can draw everything in one pass and not have to worry about these depreciated functions, plus you get full control of your modulation math. I don't know if render-to-texture is what you want to be using here, but it doesn't seem to have anything to do with your modulation issue.   ;  The big question is whether or not you're batching your draw calls, or are you drawing one tile per draw call (draw call pair, apparently?)Material batching is really the only limiting factor on today's graphics cards unless you've got an excruciatingly inneficient shader. You've got access to more vertex-trasnforming and pixel-pushing power than you can possibly imagine, but changing materials is still slow due to all the machinery that goes into motion behind the scenes -- textures are flushed and reloaded, pipelines are flushed and reset, lots and lots of internal state changes when the material changes.If you google "material batching", you should find a good deal of information, but in general what you want to do, in a tile-based scenario, is pull together all related tiles into a single texture, and then build up a single draw call who's vertices index into that texture. You ought to be able to add the color to the vertices directly.You really have to do this -- you get maybe a thousand or so material switches per frame, and depending on the size of your tiles and the resolution, its possible that you could start running up against the limit just by drawing the background.   ;  I have one large texture image map, and each frame i have two draw calls, one for each layer. The first layer is just a lot of coloured quads and the second is textured quads modulated with another colour. If that makes sense.I'm thinking of going with a simple shader.   