简体   繁体   中英

Porting a game from Android SDK GLES 1.0 to NDK GLES 2.0?

I'm currently developing an Android game using the SDK GLES10 and I'm experiencing some performace issues with it on not so good phones like the Samsung Galaxy Ace. So I've thought about porting it to the NDK and maybe also make it use GLES20, at least the rendering part which comsumes the most CPU time.

(on the Galaxy S2 it runs with constant 61 FPS, on the Galaxy Ace it varies between 90 and 20 FPS and is stuttering most of the time)

most CPU time consumnig methods on both Galaxy S2 and Galaxy Ace are GLES10.glDrawElements() , GLES10.glVertexPointer() and GLES10.TexCoordPointer() . like 85% of overall CPU time used on the Ace and 82% on the S2.

Would it drastically increase the performance to 1. use the NDK for rendering and 2. port it to GLES20?

It really probably just depends on what you're already doing.

I'd look at finding specific bottlenecks. Saying that "rendering" is a bottleneck is way too vague to be useful.

What is holding you back exactly?

  • SwapBuffers call time?
  • too many OpenGL state changes?
  • GPU vertex bound?
  • GPU fill-rate bound?

Depending on the answer to this using NDK may help, or it may not help at all, depending on if your GPU is the limiting factor.

NDK might help you get calls to the GPU with less overhead, but you don't know if that's whats actually holding you back.

Try using the DDMS traceview if you haven't yet, and see where most of your time is going, then you can make an informed decision before you go through the trouble of a major rewrite.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM