Reputation: 868
I am using iSGL3D for an application for the iPad. It's quiete simple. I want to draw 50 cubes or so, with textures. When drawing those 50 cubes, my 'frames per second' gets down to about 30 FPS. If I try to draw something like 150 cubes or so, it even get's worse and it'll be running at about 14 FPS. Because of the nature of my application, it could be happening that is has to draw like 300 cubes, and I don't even want to imagine what a horrible FPS i will get...
So, let's get to the point. I want to know if there is something else, simular to iSGL3D but much faster. If I look at some apps with really advanced 3D scenes and stuff, then I can't imagine that my little cubes are getting such a bad FPS.
The cubes to be drawn are given by a server in JSON format. They are NOT created using some editor like 3dsmax or Maya or something like that. All the cubes will need to be drawn programmatically.
I'd like to thank you in advance..
Robert
Upvotes: 1
Views: 703
Reputation: 1423
I'm not an expert on ISGL3d but currently working on it so here are a few tips you can try to increase the performance:
If each of your cubes are not using different textures or materials, create the materials in a dictionary or array than assign them to your cubes. If you are creating a material object for each cube than you're wasting great amount of resources.
As Max said in opengl terms, its possible in ISGL3D to create a mesh first, then create object instances from the same mesh(set of vertexes I mean) and apply transforms as necessary. This will greatly improve the performances.
Not only opengl calls drop your frame rate but also your program effects the general performance. So make sure that your calls to your json server are not effecting your frame rate.
Upvotes: 2
Reputation: 16709
I prefer to use OpenGL. It just gives you more control.
Use only single vertex set for your cubes and only change transformation (translate/scale/rotate) and color/material/texture. This very simple trick will give you significant performance boost.
Upvotes: 0