Why Is GPU Vertex Processing Cost So High Even When Only a Small Part of the Scene Is Visible?
We found that the GPU side vertex processing cost is very high and would like to understand what causes it and how to solve it. From the GameOptim GOT Online report, the large map scene contains approximately 360,000 triangles in total, while the currently visible area only contains about 40,000 triangles. https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/ccfbcba0 2a9d 438e ace6 cd47d114077b.png
This is a typical issue caused by large scale Mesh merging reducing CPU side culling granularity . When a large number of small meshes spanning wide spatial ranges are merged into a single oversized Mesh, Unity performs visibility culling on the CPU side using the entire Renderer’s bounding box as the evaluation unit. As long as this bounding box intersects with the camera’s view frustum, the whole Mesh may continue entering the GPU processing pipeline. The project already shows a clear oversized Mesh issue. From the Mesh resource details in the report, one Mesh resource occupies 11MB and contains approximately 210,000 vertices . https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/eb8626c2 1db0 4134 8d24 9e03c33b1d29.png Combined with the scene distribution, this strongly suggests the existence of large scale cross region Mesh merging. This aggressive merging approach significantly reduces the effectiveness of CPU side culling. Even if only a small portion of the Mesh is visible on screen, a large amount of data that should not participate in the current frame may still enter the GPU front end processing stage. Although modern GPUs have hardware level culling capabilities and some invisible triangles may be discarded in later stages, the additional: vertex processing cost pipeline scheduling cost data transfer cost have already been incurred. This ultimately increases GPU pressure and bandwidth usage. Solutions It is not recommended to manually merge a large number of cross region objects into a single oversized Mesh. Compared with manual large scale Mesh merging, it is recommended to prioritize Unity’s native official mechanisms, such as: Static Batching GPU Instancing SRP Batcher When batching, spatial locality should be carefully controlled. Avoid merging a large number of objects across different regions or visibility ranges into the same Renderer. A more reasonable approach is to preserve an appropriate Mesh split granularity so that the engine can perform CPU side culling normally. This allows invisible objects to be culled earlier at the CPU stage, reducing unnecessary data submission and GPU pipeline pressure. It should be noted that: Reducing Draw Calls does not necessarily mean improving GPU performance. If batching is aggressively applied over large distances, causing excessively large bounding volumes, CPU side culling efficiency will be weakened, and a large amount of originally invisible data may continue entering the GPU pipeline. The final result may be: Draw Calls are reduced, but GPU pressure becomes even higher.