What is the fastest way to draw a lot of Points in OpenGL ES?
I'm making a game for android where I need 开发者_运维知识库to draw a lot of points that change position every frame. I use the ndk to get faster processing performance of the math/physics section of the game, so I need to use OpenGL to get the fastest performance.
Right now, I make a texture every frame out of an array that holds the colors of every pixel. I am only able to get ~10 frames per second with this method. Is there anyway I could speed this up?
Vertex Buffer Objects (VBO's) might be what you're after. There's a nice tutorial here.
For now Android only guarantees OpenGL ES 1.0 and VBO's weren't in until 1.1. You can create two GLSurfaceView.Renderers, one that uses glDrawArrays that will work with 1.0 and one that uses VBOs for 1.1 and swap them out based on a check for 1.1 compatibility.
精彩评论