5

How many maximum triangles can be drawn on ipad in a single frame. Also, is there a limit to the number of gl calls used to draw those triangles?

Rob Hruska
  • 118,520
  • 32
  • 167
  • 192
kd3D
  • 63
  • 1
  • 1
  • 5
  • This highly depends on how you draw them. Do you use VBOs? What datatype do you use? Do you have an stencil and depth buffer? How many textures do you need to bind? How large are these textures? What are you doing in your vertex and fragment shaders? Or do you use OpenGL ES 1.1? – JustSid May 30 '11 at 10:23
  • 1)i use vbos 2)GLfloat ,GLushort 3)depth 4)50 5)1024*1024 6)no shaders 7)1.1 – kd3D May 30 '11 at 10:25

1 Answers1

6

The only limit on total triangles that you'll run into on the iPad is in terms of memory size and how quickly you wish for this to render. The more vertices you send, the more memory your application will use, and the slower it will render.

For example, in my benchmarks I was able to push over 1,800,000 triangles per second on an iPad 1 using OpenGL ES 1.1 smooth shading, a single light source, geometry stored in vertex buffer objects (VBOs), and vertices represented by GLshorts in order to minimize total size. The iPad 2 is significantly faster than that, especially when you start doing more complex operations in your fragment shaders. From that number, I can estimate that I'd want to have fewer than 30,000 triangles in my scene geometry if I wanted to render at 60 FPS on the iPad 1.

OpenGL ES 2.0 shaders make things more complicated because of their varying complexity, but they enable new effects and may allow you to use fewer triangles to achieve the same image quality as the fixed function pipeline.

For another example, in this question Davido has a model with about 900,000 triangles that he's able to render at nearly 10 FPS on an iPad 2. I also present some geometry optimization techniques in my answer there that I've found to have a significant impact on OpenGL ES 1.1 rendering when you are maxing out tiler utilization on the device.

Community
  • 1
  • 1
Brad Larson
  • 170,088
  • 45
  • 397
  • 571
  • I tried to go with GLshort for my vertices but then I don`t get my scene to render properly(objects were missing their shape) So,I resorted to cutting down my geometry and have divided it into parts so they are drawn only when in view – kd3D Jun 03 '11 at 08:27
  • Also my render utilization is 100% but tiler utilization is 62% – kd3D Jun 03 '11 at 08:28
  • @kd3D - You do need to account for the fact that GLshort ranges from -32768 to 32768, and adjust your rendering appropriately when using it. However, I no longer recommend it in OpenGL ES 2.0, because on the PowerVR SGX series a conversion needs to be made to get it into floating point format within the GPU. In your case, you look to be fill rate limited, so you're not really having a problem in terms of triangles being rendered. Instead, you need to reduce the number of fragments rendered and the work done per fragment. – Brad Larson Jun 03 '11 at 17:30