Search code examples
iosperformanceopengl-estexturestexture-mapping

Texture Atlas - Matrices or Coordinates?


When using texture atlases (I'm using OpenGL ES 1.1 and 2.0 on iOS), which has better performance: Using matrices to get the right piece of the atlas for each object, or using texture coordinates?


Solution

  • I'd say that 'using texture coordinates' should be faster in the average case : in this case, you can have the opportunity to have less draw calls. In the best case, you can submit all your objects in a single draw call.

    For texture matrices, in average, you have to change it between each object, so you have to submit one object per draw call.

    Of course, as usual in graphics, your mileage may vary depending on your specific context, and you may find specific optimization opportunities in your case. If the performance gain is really important for your application, you should try both and profile your performance.