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图形处理硬件标 ...
随机推荐
- 跨域解决方案之HTML5 postMessage
问题场景: web是嵌入到手机客户端中的静态页面,为了统计用户行为需要引入ga,但是ga必须是在www下才行,哪怕是localhost,这就是矛盾.解决方案是在页面中使用iframe,iframe是在 ...
- Android蓝牙自动配对Demo,亲测好使!!!
蓝牙自动配对,即搜索到其它蓝牙设备之后直接进行配对,不需要弹出配对确认框或者密钥输入框. 转载请注明出处http://blog.csdn.net/qq_25827845/article/details ...
- How to import Django DB operations out of Django projects
i am not familiar with DB opertions. usually i stroe data to txt and other formats. as DB is more an ...
- java实现哈弗曼树和哈夫曼树压缩
本篇博文将介绍什么是哈夫曼树,并且如何在java语言中构建一棵哈夫曼树,怎么利用哈夫曼树实现对文件的压缩和解压.首先,先来了解下什么哈夫曼树. 一.哈夫曼树 哈夫曼树属于二叉树,即树的结点最多拥有2个 ...
- Surrounded Regions [未完成]
思路完全一样 AC的代码: class Solution { private: struct Point { int x, y; Point(int _x, int _y):x(_x), y(_y) ...
- C++的虚析构
最近准备复习一遍所有的知识点,先从基础开始做起,用几分钟写个继承和析构吧. 父类为A,子类为B,代码如下: class A { public: A() { cout << "构造 ...
- 小程序——微信小程序初学踩过的坑
微信小程序初学踩过的坑 一.前言 最近因为某些需要和个人兴趣打算开发一下微信小程序,经过在官方网站上的基本了解,我大体知道了微信小程序开发的大致过程,其实最本质的就是MVVM,借用了很多模式上 ...
- 贴现力 (force of discount)
一.定义 用贴现函数a-1(t) 代替累积函数,在 t 时刻的贴现力为 增加一个负号使得贴现力为正. 二.重要的公式
- jmeter测试mysql性能
1.下载jdbc.将jdbc解压,将mysql-connector-java-version-ga-bin.jar这个文件copy到jmeter/lib下 2.打开jmeter,设置jdbc请求. 1 ...
- call/apply
call与apply都可以改变this指向,但是传参列表不同. call 任何一种方法都可以.call,借用别人函数,自己用. call只需把实参按照形参的个数传进去,apply只能传一个argume ...