NEW STATE Mobile با استفاده از Android GPU Inspector استفاده از GPU را تا 22 درصد کاهش می دهد
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
پس زمینه
NEW STATE Mobile یک بازی بتل رویال از Krafton است که در نوامبر 2021 در سراسر جهان عرضه شد و در اولین ماه عرضه به بیش از 45 میلیون دانلود رسید. KRAFTON، Inc. مجموعه ای از استودیوهای مستقل بازی سازی است که برای ایجاد تجربیات سرگرمی خلاقانه و جذاب برای گیمرها در سراسر جهان گرد هم آمده اند. این شرکت متشکل از PUBG Studios، Bluehole Studios، Striking Distance Studios، RisingWings، Dreammotion و 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 درصد کاهش یافته است. از طریق فرمت رنگ صحنه 32 بیتی، استفاده از GPU تا 5.3 درصد کاهش یافت. Shaders Busy 2% کاهش یافت و کل GPU خوانده شده از حافظه سیستم 330 مگابایت بر ثانیه کاهش یافت. مقداری که GPU روی حافظه سیستم مینویسد 78 مگابایت بر ثانیه و خواندن حافظه بافت نیز 43 مگابایت بر ثانیه کاهش یافته است.
بهینه سازی گذر سایه : هنگامی که مش ها به عنوان کاستور سایه استفاده می شوند، استفاده از LOD چند ضلعی بالا واقعاً تفاوتی در کیفیت ایجاد نمی کند. ترجیحاً از LOD چند ضلعی کم استفاده شود که به کاهش تعداد مثلث ها کمک می کند. در Unreal Engine 4، LOD کم چند ضلعی را می توان از طریق دستور کنسول "ForceLODShadow" استفاده کرد.
اندازه گیری ضربه : تعداد مثلث های مورد استفاده برای سایه ها حدود 120000 کاهش یافت. داده های شمارنده GPU در AGI نشان داد که استفاده از GPU حدود 2٪ کاهش یافته است، مقدار حافظه GPU خوانده شده از حافظه سیستم 130MB/s کاهش یافته است، و مقدار نوشته شده از GPU به حافظه سیستم حدود 23MB کاهش یافته است.
نمونهسازی خودکار : نمونهسازی خودکار، که میتواند برای بهینهسازی shadow pass و base pass اعمال شود، به شما امکان میدهد تا همان دستورات رندر را در زمان اجرا ادغام کنید و سپس به یکباره رندر شوند. این به NEWSTATE موبایل اجازه داد تا بدون از دست دادن عملکرد، نور سراسری را روی اشیاء جداگانه اعمال کند. نمونهسازی خودکار یک ویژگی اساسی است که توسط UnrealEngine4 ارائه شده است.
تاثیر اندازه گیری شده : تماس های قرعه کشی به میزان 500 کاهش یافت. حدود 48 درصد از تماس های قرعه کشی را کاهش داد. استفاده از GPU حدود 3.5٪ کاهش یافته است. این اندازه گیری ها با استفاده از OpenGL انجام شد.

شکل 3 : داده های داخلی کاهش مصرف GPU را نشان می دهد
نتایج
با استفاده از AGI، NEW STATE Mobile استفاده از GPU خود را 22٪ کاهش داد. از پیشگذر عمقی و بهینهسازی گذر سایه، استفاده از GPU به ترتیب ۱۹ و ۳ درصد کاهش یافت. فراخوانی ها و کل حافظه خوانده و نوشته شده توسط GPU از حافظه سیستم نیز به میزان قابل توجهی کاهش یافت.
شروع کنید
با شناسایی مسائل مربوط به عملکرد و مناطقی که باید با بازرس GPU Android (AGI) بهینه سازی کنید، چگونه تأثیر بازی خود را بر دستگاه های Android تجزیه و تحلیل کنید.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و 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)."]]