I have a simple question concerning the render performance under OpenGL ES.
Lets assume i am rendering a simple 2D particle system, with lets say 1000 particles, on a mobile device like an iPhone or Samsung Galaxy S.
All particles are rendered from the same textures. Particles get scaled and rotated during their lifecycle. We are talking about OpenGL ES here.
What is the more practicable way:
1) Setup a batch of vertices and transform each particle into it ( using the CPU to do the required transformation) then do 1 single call to glDrawArrays to draw all particles at once.
2) Draw each single particle using (pseudo!) code like this:
glPushMatrix();
glColor4f(_act_color.r, _act_color.g, _act_color.b, _act_color.a);
glTranslatef(_pos.x, _pos.y, 0.0f);
glRotatef(_rot, 0, 0, 1);
glVertexPointer(2, GL_FLOAT, sizeof(vertexVT), &verBuf[0].v[0]);
glTexCoordPointer(2, GL_FLOAT, sizeof(vertexVT), &verBuf[0].t[0]);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glPopMatrix();
Which way is better. When choosing the first way, it requires more CPU power, but it should behave the same on all devices. One withdraw of the first way will be that I get some vertex overhead because I have to use "degenerated" vertices between every particle.
Second way does transformation in HW but will all the Open GL commandos behave the same way on different platforms?
What is your opinion to each implementation? I would like to show up the pros and contras of each way.