Hey guys,
I’ve recently ported over a simple Particle system from C to lwjgl and I’m trying to optimize and extend it a bit.
In C, the author has each particle rendering itself as a single 4 sided GL_POLYGON using begin and end and 4 vertices. This approach obviously results in a lot of JNI overhead in Java. I moved the begin and end outside of the particle’s render method and changed from POLYGON to QUAD (as the red book suggests) but of course, that only helps a tiny amount.
What I’m wondering (yes, I’m finally getting to the point :o) is if any of you have any tricks up your sleeve for optimizing sending large numbers of vertices to OpenGL. Since the positions, sizes and colors are dynamic, I know I can’t use display lists. I’ve used Vertex Arrays elsewhere in my app, but I don’t know if I that would help here since each round through the code would mean reconstituting the arrays.
Any ideas?
