Author: http://www.cnblogs.com/open-coder/p/3898224.html

Get Start

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”:



 

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?
……

 

PerfHUD Usage

PerfHUD could allow you do some test directly and check whether those are the bottle necks of the game, just as the following diagram:

You could uncheck one of them, and see fps on the dashboard window status bar. This will help you make sure whether one of them will be the bottle neck.
2x2 Texture: too many and large textures and texture cache missing was the bottle neck:
Ignore Draw Calls: too many draw calls and GPU is the bind;
Null Fragment shader: fragment shader was too expensive;
Null viewport: a very small view port; Vertex transform, too many draw calls, too many render state switch may be the reason.
Disable Blending: alpah blend, particlse effects may be the reasons;
Disable Clear: glClear function take too much time;
Disable Texture Upload: texture content take too much bindwith, transform from Main memory to GPU memory;
Disable Buffer Data: vertex data, static or dynamic, transform from Main memory to GPU memory;
Disable Unfirm Upload: parameters that pass to material shader.

最新文章

  1. [原]常用sqlserver数据库使用sql语句
  2. Java—面向对象—权限修饰符及思维导图
  3. c++基础(三):多态
  4. 浅谈break 、continue、return,goto四种语句的区别。
  5. Activity和Fragment生命周期变化
  6. git diff 使用
  7. Ajax请求URL后加随机数原理
  8. Python 得到Twitter所有用户friends和followers
  9. Spring MVC__自定义日期类型转换器
  10. xampp访问phpmyadmin访问不了
  11. TCP/IP OPTION字段
  12. Maven项目下update maven后Eclipse报错
  13. ios蓝牙自定义快捷键
  14. BZOJ 3993 [SDOI2015]星际战争 | 网络流 二分答案
  15. DDD领域模型企业级系统Unity(五)
  16. C#中计算时间差
  17. 工控机安装Ubuntu14.04
  18. 图解SQL的inner join、left join、right join、full outer join、union、union all的区别【转载】
  19. xgboost 和GBDT的区别
  20. appium 元素定位工具

热门文章

  1. 谈谈HTML5中的history.pushSate方法,弥补ajax导致浏览器前进后退无效的问题
  2. vuex的初始化
  3. php基础部分(1)
  4. CentOS 7运维管理笔记(11)----解决配置静态IP还是会出现动态IP地址的问题
  5. 基础架构之Redis
  6. Session、Cookie详解(2)
  7. Docker_3 数据卷
  8. QT网络编程Tcp下C/S架构的即时通信
  9. DESCRIBE:When you mouse click right-side is open an application and click left-side is attribution.
  10. 修改virtual box中ubuntu lubuntu 的分辨率