新 STATE Mobile 利用 Android GPU 检查器将 GPU 使用量降低了 22%
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
背景
NEW STATE Mobile 是 Krafton 的一款大逃杀游戏于 2021 年 11 月面向全球发布,在发布后的第一个月便获得了超过 4500 万次下载。KRAFTON, Inc. 是一个由多个独立的游戏开发工作室组成的联合公司,旨在为全球游戏玩家打造富有吸引力的创新娱乐体验。该公司包括 PUBG Studio、Bluehole Studio、Striking Distance Studio、RisingWings、Dreamotion 和 Unknown Worlds,并且每个都有自己独特的专业知识。新 STATE Mobile 是使用 Unreal Engine 4 构建的,我们已尝试过利用其独特的游戏功能来减少因 GPU 使用率过高而导致的热量和耗电量。
玩家可以参加远距离战斗,因此游戏引擎需要能够渲染远距离的场景。此外,战场中存在大量植被,导致这些植被过度绘制,从而对效果下降产生重大影响。这促使该团队使用 Android GPU 检查器 (AGI) 帮助优化游戏的 GPU 使用情况并消除瓶颈。

图 1:NEW STATE Mobile 的屏幕截图
策略
NEW STATE Mobile 使用 AGI 获取大量 GPU 计数器信息,并相应地优化其 GPU 使用率。他们借助 AGI 提供的 GPU 活动分析数据发现了不必要的渲染通道。在确定哪些细分占用了 GPU 使用量和内存带宽后,他们持续使用 GPU 计数器和 GPU 活动来检查优化进度,以检查它们是否正朝着正确的方向前进。

图 2:NEW STATE Mobile 的屏幕截图
以下是他们利用 AGI 了解到的有关游戏性能的一些信息:
基础传递优化:深度预传递这项技术可提高 Early-z 的使用率,有助于减少 Fragment 着色的使用。深度预传递专门用于 LOD0,该 LOD0 会占据大部分屏幕空间,从而最大限度地减少了可能由其他绘制调用产生的负担。此外,使用 32 位场景颜色格式可以提高整个渲染通道的性能。UnrealEngine4 的默认 SceneColor 格式为 FloatRGBA,即 64 位。如果使用 32 位格式,内存带宽可以减少一半。
测量影响:应用深度预传递后,GPU 利用率降低了 7.5%。由于深度预传递,更多 Fragment 可能处于 Early-Z。fragment 着色所需的时间缩短了 2%。采用 32 位场景颜色格式后,GPU 利用率降低了 5.3%。着色器繁忙度降低了 2%,并且 GPU 总读取速度减少了 330 MB/秒。GPU 写入系统内存的数据量减少了 78 MB/秒,纹理内存读取量也减少了 43 MB/秒。
阴影传递优化:将网格用作阴影投射器时,使用高多边形 LOD 并不会对质量产生实际影响。最好使用低多边形 LOD,这有助于减少三角形的数量。在 Unreal Engine 4 中,可通过控制台命令“ForceLODShadow”使用低多边形 LOD。
测量影响:用于阴影的三角形数量减少了约 120,000 个。AGI 中的 GPU 计数器数据显示,GPU 用量减少了约 2%,从系统内存读取的 GPU 内存量减少了 130 MB/秒,从 GPU 写入系统内存量减少了约 23 MB。
自动实例:自动实例可同时应用于阴影传递和基本传递优化,让您可以在运行时合并相同的渲染命令,然后一次性渲染所有这些命令。这使得 NEWSTATE Mobile 能够对单个对象应用全局光照,而不会降低性能。自动实例是 UnrealEngine4 提供的一项基本功能。
衡量影响:绘制调用次数减少了 500 次。减少了约 48% 的绘制调用。GPU 利用率降低了约 3.5%。这些测量是使用 OpenGL 进行的。

图 3:显示 GPU 使用量减少情况的内部数据
成果
通过使用 AGI,NEW STATE Mobile 将 GPU 使用量降低了 22%。与深度预传递和阴影传递优化相比,GPU 使用率分别下降了 19% 和 3%。绘制调用以及 GPU 从系统内存读取和写入的总内存也大幅减少了。
开始使用
了解如何使用 Android GPU 检查器 (AGI) 找出性能问题和有待优化的方面,从而分析游戏对 Android 设备的影响。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2022-02-25。
[null,null,["最后更新时间 (UTC):2022-02-25。"],[],[],null,["# NEW STATE Mobile reduces GPU usage by 22% with Android GPU Inspector\n\nBackground\n----------\n\n[NEW STATE Mobile](https://play.google.com/store/apps/details?id=com.pubg.newstate) is a battle royale game from Krafton that launched Nov 2021 worldwide, and reached 45M+ downloads in the first month of launch. KRAFTON, Inc. is a collective of independent game development studios brought together to create innovative and engaging entertainment experiences for gamers across the world. The company consists of PUBG Studios, Bluehole Studio, Striking Distance Studios, RisingWings, Dreamotion, and Unknown Worlds, each with its own unique expertise. NEW STATE Mobile was created with Unreal Engine 4, and various attempts have been made to reduce heat and battery consumption caused by high GPU usage from their distinctive gaming features.\n\nGamers can play long range battles, so the game engine needs to be able to render scenes from quite a distance. Also, numerous vegetations are present in the battleground, leading the overdraw of these vegetations to have a substantial impact on decreasing performance. This led the team to [Android GPU Inspector](http://developer.android.com/agi) (AGI) to help optimize the game's GPU usage and eliminate bottlenecks.\n\n**Figure 1**: Screenshot from NEW STATE Mobile\n\nWhat they did\n-------------\n\nNEW STATE Mobile used AGI to access loads of GPU counter information and optimize their GPU usage accordingly. They identified unnecessary render passes with the help of the GPU activity profiling data provided by AGI. After identifying which segments were taking up GPU usage and memory bandwidth, they continued to check the optimization progress using the GPU Counter and GPU activity back and forth to check if they were headed in the right direction.\n\n**Figure 2**: Screenshot from NEW STATE Mobile\n\nHere are a few things they learned about the game's performance using AGI:\n\n- **Base pass optimization**: Depth prepass, which is a technology that increases usage of Early-z, helped decrease the use of fragment shading. Depth prepass was specifically used for LOD0 which takes up most of the screen space, minimizing the burden that can come from additional draw calls. Also, using the 32-bit scenecolor format can increase the performance of the entire render pass. Default SceneColor format of UnrealEngine4 is FloatRGBA, which is 64-bit. If a 32-bit format is used, memory bandwidth can be reduced by half.\n\n- **Impact measured**: After applying depth prepass, GPU utilization dropped by 7.5%. Due to the depth prepass, more Fragments could be Early-Z. The rate of time required for fragment shading has decreased by 2%. Through the 32-bit scenecolor format, GPU utilization was reduced by 5.3%. Shaders Busy decreased by 2%, and total GPU read from system memory decreased 330 MB/s. The amount the GPU writes to system memory was reduced by 78 MB/s and Texture memory read was also reduced by 43 MB/s.\n\n- **Shadow pass optimization**: When meshes are used as shadow casters, using high polygon LOD does not really make a difference in quality. It is preferred to use low polygon LOD which helps reduce the number of triangles. In Unreal Engine 4, low polygon LOD can be used via the console command 'ForceLODShadow'.\n\n- **Impact measured**: The number of triangles used for shadows decreased by about 120,000. The GPU counter data in AGI showed that GPU usage decreased about 2%, the amount of the GPU memory read from the system memory decreased 130MB/s, and the amount written from the GPU to the system memory decreased about 23MBs.\n\n- **Auto-instancing**: Auto-instancing, which can be applied for both shadow pass and base pass optimization, allows you to merge the same render commands at runtime and then be rendered all at once. This allowed NEWSTATE mobile to apply global illumination to individual objects without losing performance. Auto-instancing is a basic feature provided by UnrealEngine4.\n\n- **Impact measured**: Draw calls were reduced by 500. It reduced about 48% of the draw calls. GPU utilization decreased about 3.5%. These measurements were taken using OpenGL.\n\n**Figure 3**: Internal data showing GPU usage reduction\n\nResults\n-------\n\nBy using AGI, NEW STATE Mobile reduced its GPU usage by 22%. From depth prepass and shadow pass optimization, GPU usage was down by 19% and 3% respectively. Draw calls and the total memory read and written by GPU from system memory was also substantially reduced.\n\nGet started\n-----------\n\nLearn how to analyze the impact of your game on Android devices by identifying performance issues and areas to optimize with the [Android GPU Inspector](https://developer.android.com/agi) (AGI)."]]