NEW STATE Mobile ลดการใช้งาน GPU ลง 22% ด้วยเครื่องมือตรวจสอบ GPU ของ Android
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ฉากหลัง
NEW STATE Mobile เป็นเกมแบตเทิลรอยัลจาก Krafton ที่เปิดตัวไปทั่วโลกเมื่อเดือนพฤศจิกายน 2021 และได้รับการดาวน์โหลดกว่า 45 ล้านครั้งในเดือนแรกของการเปิดตัว KRAFTON, Inc. เป็นกลุ่มสตูดิโอพัฒนาเกมอิสระที่รวมตัวกันเพื่อสร้างประสบการณ์ความบันเทิงที่แปลกใหม่และน่าสนใจให้แก่เกมเมอร์ทั่วโลก บริษัทประกอบด้วย PUBG Studios, Bluehole Studio, Striking Distance Studios, RisingWings, Dreamotion และ Unknown Worlds ซึ่งแต่ละบริษัทมีความเชี่ยวชาญเฉพาะตัว NEW STATE Mobile สร้างขึ้นด้วย Unreal Engine 4 และเราได้พยายามหลายวิธีเพื่อลดความร้อนและการสิ้นเปลืองแบตเตอรี่ที่เกิดจากการใช้งาน GPU สูงจากฟีเจอร์การเล่นเกมที่โดดเด่น
เกมเมอร์สามารถเล่นเกมการต่อสู้ระยะไกลได้ เครื่องยนต์ของเกมจึงต้องแสดงผลฉากจากระยะไกลได้ นอกจากนี้ ยังมีพืชพันธุ์จำนวนมากในสนามรบ ซึ่งทำให้การวาดภาพพืชพันธุ์เหล่านี้มากเกินไปส่งผลต่อประสิทธิภาพที่ลดลงอย่างมาก ด้วยเหตุนี้ ทีมจึงพัฒนา Android GPU Inspector (AGI) เพื่อช่วยเพิ่มประสิทธิภาพการใช้ GPU ของเกมและขจัดปัญหาคอขวด

รูปที่ 1: ภาพหน้าจอจาก NEW STATE Mobile
สิ่งที่พวกเขาทำ
NEW STATE Mobile ใช้ AGI เพื่อเข้าถึงข้อมูลตัวนับ GPU จำนวนมากและเพิ่มประสิทธิภาพการใช้ GPU ให้เหมาะสม พวกเขาระบุการผ่านการแสดงผลที่ไม่จำเป็นด้วยความช่วยเหลือของข้อมูลการโปรไฟล์กิจกรรม GPU ที่ AGI มีให้ หลังจากระบุกลุ่มที่ใช้แบนด์วิดท์หน่วยความจำและ GPU แล้ว ทีมตรวจสอบความคืบหน้าของการเพิ่มประสิทธิภาพโดยใช้ตัวนับ GPU และกิจกรรม GPU อย่างต่อเนื่องเพื่อดูว่ากำลังเดินไปในทิศทางที่ถูกต้องหรือไม่

รูปที่ 2: ภาพหน้าจอจาก NEW STATE Mobile
ต่อไปนี้คือสิ่งที่ทีมได้เรียนรู้เกี่ยวกับประสิทธิภาพของเกมโดยใช้ AGI
การเพิ่มประสิทธิภาพการผ่านฐาน: การแสดงผลภาพระดับความลึกล่วงหน้า ซึ่งเป็นเทคโนโลยีที่เพิ่มการใช้งาน Early-z ช่วยลดการใช้การแรเงาเศษ การแสดงผลภาพล่วงหน้าแบบใช้ข้อมูลความลึกมีไว้สำหรับ LOD0 โดยเฉพาะ ซึ่งกินพื้นที่หน้าจอส่วนใหญ่ จึงช่วยลดภาระที่อาจเกิดขึ้นจากการเรียกใช้การวาดเพิ่มเติม นอกจากนี้ การใช้รูปแบบสีฉาก 32 บิตยังช่วยเพิ่มประสิทธิภาพของทั้งการผ่านการแสดงผลได้อีกด้วย รูปแบบ SceneColor เริ่มต้นของ UnrealEngine4 คือ FloatRGBA ซึ่งเป็น 64 บิต หากใช้รูปแบบ 32 บิต แบนด์วิดท์ของหน่วยความจําจะลดลงครึ่งหนึ่ง
ผลกระทบที่วัดได้: หลังจากใช้การผ่านข้อมูลล่วงหน้าของภาพความลึก การใช้งาน GPU ลดลง 7.5% เนื่องจากการผ่านข้อมูลล่วงหน้าเกี่ยวกับความลึก อาจมีเศษเสี้ยวจำนวนมากขึ้นที่ใช้ Early-Z อัตราเวลาที่ต้องใช้สำหรับการแรเงาเศษลดลง 2% การใช้ GPU ลดลง 5.3% เมื่อใช้รูปแบบสีฉาก 32 บิต Shaders Busy ลดลง 2% และการอ่าน GPU ทั้งหมดจากหน่วยความจำระบบลดลง 330 MB/วินาที ปริมาณที่ GPU เขียนลงในหน่วยความจำระบบลดลง 78 MB/วินาที และการอ่านหน่วยความจำพื้นผิวก็ลดลง 43 MB/วินาทีด้วย
การเพิ่มประสิทธิภาพการพาสเงา: เมื่อใช้เมชเป็นตัวสร้างเงา การใช้ LOD ของรูปหลายเหลี่ยมสูงจะไม่ส่งผลต่อคุณภาพมากนัก เราขอแนะนำให้ใช้ LOD รูปหลายเหลี่ยมต่ำซึ่งจะช่วยลดความซับซ้อนของรูปสามเหลี่ยม ใน Unreal Engine 4 คุณสามารถใช้ LOD แบบรูปหลายเหลี่ยมต่ำผ่านคำสั่งคอนโซล "ForceLODShadow"
ผลกระทบที่วัดได้: จำนวนสามเหลี่ยมที่ใช้สำหรับเงาลดลงประมาณ 120,000 รายการ ข้อมูลเคาน์เตอร์ GPU ใน AGI แสดงให้เห็นว่าการใช้งาน GPU ลดลงประมาณ 2%, ปริมาณหน่วยความจำ GPU ที่อ่านจากหน่วยความจำระบบลดลง 130 MB/วินาที และปริมาณที่เขียนจาก GPU ไปยังหน่วยความจำระบบลดลงประมาณ 23 MB/วินาที
การสร้างอินสแตนซ์อัตโนมัติ: การสร้างอินสแตนซ์อัตโนมัติซึ่งใช้ได้กับทั้งการเพิ่มประสิทธิภาพของ Shadow Pass และ Base Pass ช่วยให้คุณผสานคําสั่งแสดงผลเดียวกันที่รันไทม์ แล้วแสดงผลพร้อมกันทั้งหมดได้ ซึ่งช่วยให้ NEWSTATE mobile ใช้การจัดแสงโดยรวมกับวัตถุแต่ละชิ้นได้โดยไม่สูญเสียประสิทธิภาพ การสร้างอินสแตนซ์อัตโนมัติเป็นฟีเจอร์พื้นฐานที่ UnrealEngine4 มีให้
ผลกระทบที่วัดได้: การเรียกใช้การวาดลดลง 500 ครั้ง ซึ่งช่วยลดการเรียกใช้การวาดประมาณ 48% การใช้งาน GPU ลดลงประมาณ 3.5% การวัดเหล่านี้ดำเนินการโดยใช้ OpenGL

รูปที่ 3: ข้อมูลภายในที่แสดงการลดการใช้งาน GPU
ผลลัพธ์
เมื่อใช้ AGI ทาง NEW STATE Mobile ได้ลดการใช้งาน GPU ลง 22% จากการเพิ่มประสิทธิภาพของการแสดงผลภาพล่วงหน้าแบบความลึกและการแสดงผลเงา การใช้ GPU ลดลง 19% และ 3% ตามลำดับ การเรียกใช้การวาดและหน่วยความจําทั้งหมดที่ GPU อ่านและเขียนจากหน่วยความจําของระบบก็ลดลงอย่างมากเช่นกัน
เริ่มต้นใช้งาน
ดูวิธีวิเคราะห์ผลกระทบของเกมในอุปกรณ์ Android โดยระบุปัญหาด้านประสิทธิภาพและส่วนที่ต้องเพิ่มประสิทธิภาพด้วย Android GPU Inspector (AGI)
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2022-02-25 UTC
[[["เข้าใจง่าย","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 UTC"],[],[],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)."]]