RyanCheu
RyanCheu

Reputation: 3552

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?

Upvotes: 1

Views: 2544

Answers (2)

CaseyB
CaseyB

Reputation: 25058

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.

Upvotes: 1

Marcelo Cantos
Marcelo Cantos

Reputation: 185862

Vertex Buffer Objects (VBO's) might be what you're after. There's a nice tutorial here.

Upvotes: 1

Related Questions