码迷,mamicode.com
首页 > 移动开发 > 详细

Use PrefHUD ES to Do Frame Capture Android Game

时间:2014-08-08 01:31:04      阅读:421      评论:0      收藏:0      [点我收藏+]

标签:android   des   style   blog   http   color   os   io   

Author: http://www.cnblogs.com/open-coder/p/3898224.html
This is short tutorial about how to do frame capture with Nvidia PrefHUD. You could find a detail tutorial from here.
Before frame capture, some requirement should be fullfilled:
1) OpenGL ES 2.0 at least!
2) Internet permission required. <uses-permission android:name="android.permission.INTERNET"></uses-permission>
3) Tegra 4.0 at least device.
4) Must be Nvidia Android adb. You will failed using other adb version, Nvidia Android adb requried, no exception.
5) Before run app, type following under command line:
     adb shell setprop debug.perfhudes 1
The following are some screen shots that I frame Captured “ShadowGun”:
bubuko.com,布布扣
bubuko.com,布布扣
bubuko.com,布布扣
bubuko.com,布布扣

 

With PrefHUD ES Frame Capture, you could find the bottle neck and find the optimaztion direction:
1) How many trianges will be drawn within one frame: whether we need to reduce the scene trianges or character traingles;
2) Which one draw call cost the longgest time, is it reasonable? too many traingles? too complicated shader? vertex shader or fragment shader? Can some shader operations could be done in application code? 
    Can we move some operation from fragment shader to vertex shader? Use vertex lighting instead of pixel shader light?  Precalcualte the result and save to the texture?
3) Too many objects overlap draw with each other? Enable occlusion culling could fix this problem well.
4) Too many draw calls? Batch the objects with the same material and atlas texture.
5) Too much textures? Reduce texture size, use small texture to tiling instead of big texture to blend. Use Bilinear filter mode will be much faster than trilinear filter mode.
6) Reduce ‘glClear’ calls, it will depends on the device, some device will consume much time with ‘glClear’. Generally, we could only clear depth buffer will work. One time for main scene, the other one for HUD.
7) Avoid use complicated and switch statement in the shader. Later some super shader will support those feature well, but well those features are not supported well currently.
8) By ingore the whole render loop, and check the FPS. You could figure out whether the game is CPU bind and GPU bind.
9) LOD for scene objects.
10) Batch some small objects that near to each other. Seperate some big objects into smaller one, let view volume to cull them.
11) Above method will opimize under low level. But if you have a good level design, you could save a lot of FPS. Set up a door between a indoor area and outdoor area? Seperate the outdoor area with some view occlusion objects and equipments?
……

Use PrefHUD ES to Do Frame Capture Android Game,布布扣,bubuko.com

Use PrefHUD ES to Do Frame Capture Android Game

标签:android   des   style   blog   http   color   os   io   

原文地址:http://www.cnblogs.com/open-coder/p/3898224.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!