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.

Use PerfHUD ES to Do Frame Capture Android Game的更多相关文章

  1. Xcode OpenGL ES Frame Capture的使用

    一.使用背景 近期在Xcode中使用OpenGL ES 2.0实现一些效果,刚开始存在一些性能问题(CPU和GPU),幸运的是Xcode中自带了免费的性能工具Instruments,其中包含OpenG ...

  2. How To: Capture Android & iOS Traffic with Fiddler

    How To: Capture iOS Traffic with Fiddlerhttps://www.telerik.com/blogs/how-to-capture-ios-traffic-wit ...

  3. Android Capture Android System Audio

    项目需要获取播放视频的实时音量值,最简捷的方法是监听音频输出端,取得音频输出流,再进行转换. 调查时,首先找到这篇博客: http://blog.csdn.net/jinzhuojun/article ...

  4. Android OpenGL ES 开发(二): OpenGL ES 环境搭建

    零:环境搭建目的 为了在Android应用程序中使用OpenGL ES绘制图形,必须要为他们创建一个视图容器.其中最直接或者最常用的方式就是实现一个GLSurfaceView和一个GLSurfaceV ...

  5. Android Animation 动画Demo(Frame帧动画)

    上一页介绍Animation动画第一:Tween吐温动画. 本文介绍了以下Animation也有动画的形式:Frame帧动画. Frame动画是一系列照片示出的顺序按照一定的处理,和机制,以放电影很阶 ...

  6. Android OpenGL ES(四)关于EGL .

    OpenGL ES的javax.microedition.khronos.opengles 包定义了平台无关的GL绘图指令,EGL(javax.microedition.khronos.egl ) 则 ...

  7. Android OpenGL ES 开发(一): OpenGL ES 介绍

    简介OpenGL ES 谈到OpenGL ES,首先我们应该先去了解一下Android的基本架构,基本架构下图: 在这里我们可以找到Libraries里面有我们目前要接触的库,即OpenGL ES. ...

  8. Android OpenGL ES 入门系列(二) --- 环境搭建

    转载请注明出处 本文出自Hansion的博客 本章介绍如何使用GLSurfaceView和GLSurfaceView.Renderer完成在Activity中的最简单实现. 1.在AndroidMan ...

  9. Android API Guides---OpenGL ES

    OpenGL ES Android包含高性能2D和3D图形开放图形库(OpenGL®的).详细而言,OpenGL ES的API支持. OpenGL是一个跨平台的图形API.用于指定的3D图形处理硬件标 ...

随机推荐

  1. 面试准备之三Django知识

    Django请求流程 MTV模式 路由 视图 ORM 模板

  2. jenkins start

    author:alex.wang date:2017.05.25 system:centos7.2 ip:192.168.1.46 download: wget http://mirrors.jenk ...

  3. css outline属性

    outline属性在一个html element的周围画出一条线来,位于边框的外围,起到突出元素的作用.轮廓线不占据任何布局空间,也不一定非要是矩形. p { outline:#00FF00 dott ...

  4. 【Leetcode】【Easy】Same Tree

    Given two binary trees, write a function to check if they are equal or not. Two binary trees are con ...

  5. yii2.0发送qq邮件详情配置

    首先要想使用qq发送邮件必须打开使用的qq邮箱里的一个配置,

  6. JavaScrip File类拓展

    ##今天在做jsp的文件上传功能,想着上传文件后在当前页面把选取的文件信息展现出来,查来查去,发现了js中的file类,之前在w3c和runboob盯了好久找找不到....不过终于还是在网上查到了这个 ...

  7. Entity Framework: 主从表的增删改

    1.根据主表添加从表数据 var dest = (from d in context.Destinations where d.Name == "Bali" select d).S ...

  8. 如何使用jMeter对某个OData服务进行高并发性能测试

    For project reason I have to measure the performance of OData service being accessed parallelly. And ...

  9. 用CI框架向数据库中实现简单的增删改查

    以下代码基于CodeIgniter_2.1.3版 用PHP向数据库中实现简单的增删改查(纯代码)请戳 http://www.cnblogs.com/corvoh/p/4641476.html Code ...

  10. 使用log4j让日志写入数据库

    之前做的一个项目有这么个要求,在日志管理系统里,需要将某些日志信息存储到数据库里,供用户.管理员查看分析.因此我就花了点时间搞了一下这一功能,各位请看. 摘要:我们知道log4j能提供强大的可配置的记 ...