Use PerfHUD ES to Do Frame Capture Android Game
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的更多相关文章
- Xcode OpenGL ES Frame Capture的使用
一.使用背景 近期在Xcode中使用OpenGL ES 2.0实现一些效果,刚开始存在一些性能问题(CPU和GPU),幸运的是Xcode中自带了免费的性能工具Instruments,其中包含OpenG ...
- 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 ...
- Android Capture Android System Audio
项目需要获取播放视频的实时音量值,最简捷的方法是监听音频输出端,取得音频输出流,再进行转换. 调查时,首先找到这篇博客: http://blog.csdn.net/jinzhuojun/article ...
- Android OpenGL ES 开发(二): OpenGL ES 环境搭建
零:环境搭建目的 为了在Android应用程序中使用OpenGL ES绘制图形,必须要为他们创建一个视图容器.其中最直接或者最常用的方式就是实现一个GLSurfaceView和一个GLSurfaceV ...
- Android Animation 动画Demo(Frame帧动画)
上一页介绍Animation动画第一:Tween吐温动画. 本文介绍了以下Animation也有动画的形式:Frame帧动画. Frame动画是一系列照片示出的顺序按照一定的处理,和机制,以放电影很阶 ...
- Android OpenGL ES(四)关于EGL .
OpenGL ES的javax.microedition.khronos.opengles 包定义了平台无关的GL绘图指令,EGL(javax.microedition.khronos.egl ) 则 ...
- Android OpenGL ES 开发(一): OpenGL ES 介绍
简介OpenGL ES 谈到OpenGL ES,首先我们应该先去了解一下Android的基本架构,基本架构下图: 在这里我们可以找到Libraries里面有我们目前要接触的库,即OpenGL ES. ...
- Android OpenGL ES 入门系列(二) --- 环境搭建
转载请注明出处 本文出自Hansion的博客 本章介绍如何使用GLSurfaceView和GLSurfaceView.Renderer完成在Activity中的最简单实现. 1.在AndroidMan ...
- Android API Guides---OpenGL ES
OpenGL ES Android包含高性能2D和3D图形开放图形库(OpenGL®的).详细而言,OpenGL ES的API支持. OpenGL是一个跨平台的图形API.用于指定的3D图形处理硬件标 ...
随机推荐
- set(string str)变量传参为int的问题
if (bo.getAnesthesiaMode() != null) { if (bo.getAnesthesiaMode() != null) { CodeMstrCoMpare codeMstr ...
- 制作rpm安装包
1.安装rpmbuild软件 sudo apt-get install rpmbuild2.配置工作路径 在制作 rpm 包之前,首先要配置工作路径,也就是制作 rpm 包所在的目录.制作 rpm 包 ...
- eclipse 实用快捷键(最全)
注释: (1)Ctrl+Space 说明:内容助理.提供对方法,变量,参数,javadoc等得提示, 应运在多种场合,总之需要提示的时候可先按此快捷键. 注:避免输入法的切换设置与此设置冲突 ( ...
- Exchange 2016 体系结构简介
一.Exchange 2016简介 现在,CPU计算能力的成本显著降低,不再成为约束因素.随着此约束因素的消失,Exchange2016的主要设计目标是简化扩展.提高硬件利用率和实现故障隔离:在Exc ...
- 「C语言」数据类型及混合运算与类型转换
深入学习C语言时,有必要先了解一下数据类型的概念,以及它们之间的混合运算与类型转换. 本篇文章便是根据<C语言程序设计教程>和在线翻阅资料后整理而出.(练习题将逐步更新) 目录: ...
- Java中父类强制转换为子类的可能
之前徒弟问了一个问题, 在Java中, 父类对象到底能不能转换成对应的子类对象? 到底能不能, 今天就来说说这个问题, 先看下面一段代码: package cn.com.hanbinit.test; ...
- linux 安装pip 和python3
前言: python3应该是python的趋势所在,当然目前争议也比较大,这篇随笔的主要目的是记录在linux6.4下搭建python3环境的过程 以及碰到的问题和解决过程. 另外,如果本机安装了py ...
- whoami
功能说明:显示当前登录的用户名,.
- note05-计算机网络
5.网络安全 被动攻击(UDP报文被截获 被 进行流量分析) 主动攻击 1.篡改(更改报文流 伪报文) 2.恶意程序(病毒.木马.蠕虫.炸弹) 3.拒绝服务Dos 密码体制 1.对称密钥密码体制(DE ...
- WAS上配置数据源连接失败
问题描述: 在节点 cnshh171Node01 上的服务器 server1 上, 对数据源 testj2cbug 执行的测试连接操作 由于以下异常 java.sql.SQLException: 调用 ...