新版 STATE 行動裝置透過 Android GPU 檢查器將 GPU 用量降低 22%
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
背景
NEW STATE Mobile 是 2021 年 11 月在全球推出的大逃殺遊戲,首月就獲得超過 4, 500 萬次下載。KRAFTON, Inc. 是多家獨立遊戲開發工作室的合作對象,致力為世界各地的遊戲玩家打造創新又引人入勝的娛樂體驗。他們包括 PUBG Studios、Bluehole Studio、Striking Distance Studios、RisingWings、Dreamotion 和 Unknown Worlds,各自具備獨特的專業知識。新 STATE Mobile 是由 Unreal Engine 4 打造而成,他們已進行了許多嘗試,以降低因同類遊戲功能偏高的 GPU 用量而造成的熱用量和電池消耗量。
玩家可以進行長時間戰鬥,因此遊戲引擎必須能夠從遠處轉譯場景。此外,戰場上存在許多植被,導致這些植被的過度繪製,對於效能下降的幫助有很大的影響。因此,該團隊決定採用 Android GPU Inspector (AGI),為遊戲的 GPU 用量進行最佳化調整,並排除瓶頸。

圖 1:New STATE Mobile 的螢幕截圖
具體措施
NEW STATE Mobile 使用 AGI 存取 GPU 計數器資訊的負載,並據此最佳化其 GPU 用量。透過 AGI 提供的 GPU 活動剖析資料,找出不必要的算繪通道。找出佔用 GPU 用量和記憶體頻寬的線段後,他們持續使用 GPU 計數器和 GPU 活動來檢查最佳化進度,確認這些線段是否朝正確的方向前進。

圖 2:New STATE Mobile 的螢幕截圖
他們透過 AGI 瞭解了以下遊戲效能相關知識:
基本通過最佳化:深度預先傳遞技術會提高 Early-z 的使用率,有助於減少使用片段陰影。深度預先傳遞功能專門用於 LOD0,這會佔用大部分的螢幕空間,以便將額外繪製呼叫造成的負擔降到最低。此外,使用 32 位元的場景顏色格式也能提升整個算繪通道的效能。UnrealEngine4 的預設 SceneColor 格式是 FloatRGBA,也就是 64 位元。如果使用 32 位元格式,記憶體頻寬可能會減少一半。
已測量影響:套用深度探針後,GPU 使用率下降 7.5%。基於深度預先傳遞,更多片段可以是早期 Z 版本。片段陰影所需時間減少 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 行動裝置對個別物件套用全域照明,而不會失去效能。自動登入是 UnrealEngine4 提供的基本功能,
已評估影響:繪圖呼叫已減少 500 次。這樣就能減少約 48% 的繪製呼叫。GPU 使用率減少約 3.5%。這些測量結果使用 OpenGL。

圖 3:顯示 GPU 用量降低情形的內部資料
成果
採用 AGI 後,NEW STATE Mobile 的 GPU 用量減少了 22%。從深度預先傳遞和陰影傳遞最佳化來看,GPU 用量分別下降 19% 和 3%。此外,繪圖呼叫以及 GPU 從系統記憶體讀取及寫入的記憶體總量也大幅減少。
開始使用
瞭解如何使用 Android GPU Inspector (AGI) 找出效能問題和最佳化區域,藉此分析遊戲在 Android 裝置上的影響力。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2022-02-25 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間: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)."]]