I am looking for a way to improve particle system performance, as it is a very expensive option in terms of FPS. This is because I call:
glDrawElements(GL_TRIANGLE_STRIP, mNumberOfIndices, GL_UNSIGNED_SHORT, 0);
I call this method for each particle in my application (which can be from 1000 to 5000 particles). Please note that when you increase to 1000 particles, my application starts to fall in FPS. I use VBO: s, but the performance when calling this method is too expensive.
Any ideas how I can make the particle system more efficient?
Edit: this is how my particle system draws things:
glBindTexture(GL_TEXTURE_2D, textureObject); glBindBuffer(GL_ARRAY_BUFFER, vboVertexBuffer[0]); glVertexPointer(3, GL_FLOAT, 0, 0); glBindBuffer(GL_ARRAY_BUFFER, vboTextureBuffer[0]); glTexCoordPointer(2, GL_FLOAT, 0, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIndexBuffer[0]); Vector3f partPos; for (int i = 0; i < m_numParticles; i++) { partPos = m_particleList[i].m_pos; glTranslatef(partPos.x, partPos.y, partPos.z); glDrawElements(GL_TRIANGLE_STRIP, mNumberOfIndices, GL_UNSIGNED_SHORT, 0); gl.glTranslatef(-partPos.x, -partPos.y, -partPos.z); }
source share