Optimzing Mobile Game Rendering for 60 FPS: A Deep Dive into Project Black
Project Black, an upcoming extraction shooter game by Lila faces similar technical challenges as open-world and battle royale games, and the strategies discussed here can be applied across different mobile game genres.
Optimizing Assets and Rendering
Project Black emphasizes asset optimization as a primary means of achieving high frame rates. Some key techniques include:
- LOD changes and geometry reduction: By carefully adjusting Level of Detail (LOD) settings and simplifying geometry, the team achieved significant performance gains without sacrificing visual fidelity. For instance, a house model was reduced from 16,000 to 6,000 triangles while maintaining visual quality.
- Limiting transparent assets: Transparent assets like foliage and VFX can significantly impact performance. Keeping these assets optimized, using techniques like limiting draw calls and particle counts, is crucial.
- Single-pass rendering: Rendering the entire scene in a single pass, except for Bloom, minimizes draw calls and improves performance.
- Custom terrain system: The game utilizes a custom terrain system with optimized splatting and shaders to render detailed terrain efficiently.
Budgeting for Performance
Maintaining a strict performance budget is crucial for consistent 60 FPS gameplay. Project Black follows these guidelines:
- Triangle count: Keeping the total triangle count per frame between 100,000 and 200,000 is recommended, with dynamic geometry not exceeding 50,000 triangles.
- CPU and GPU usage: Aiming for CPU and GPU utilization below 60-70% ensures smooth gameplay even during demanding scenes.
- Resolution: Using native resolutions on mobile can be taxing. Targeting lower resolutions like 480p or 540p, especially on low-end devices, can significantly improve performance without a noticeable loss in visual quality on the device.
Custom Render Pipeline
Project Black utilizes a custom render pipeline built on Unity’s Scriptable Render Pipeline (SRP) API. This approach offers several advantages:
- Fine-grained control: The team has complete control over rendering stages, resource management, and shader generation, allowing for precise optimization.
- Reduced overhead: By tailoring the render pipeline to the game’s specific needs, unnecessary overhead from general-purpose pipelines is eliminated.
- Transparency: The SRP API provides full visibility into the rendering process, making debugging and performance analysis easier.
Shader Optimization
Shaders play a crucial role in mobile game performance. Project Black employs several strategies for efficient shader design:
- Custom shader graph: A modified Unity Shader Graph system allows artists and technical artists to create shaders easily while maintaining control over shader complexity and feature sets.
- Minimal shader complexity: Keeping shaders simple, minimizing texture reads and branching, is vital for performance.
- Shader variant management: Limiting the number of shader variants reduces memory usage and compilation time.
- HDR rendering: The game utilizes HDR rendering for improved visual quality and simplified lighting calculations.
Advanced Techniques
Project Black implements some advanced rendering techniques to further enhance performance and visual fidelity:
- Baked Shadow Map Cascades: A custom shadow mapping system caches static shadows and renders dynamic shadows on top, significantly improving performance.
- Custom MIP Fog: Based on Uncharted 4’s implementation, this custom fog solution provides directional variation and simulates atmospheric scattering efficiently.
- PSO Pre-warming: A custom solution pre-compiles Pipeline State Objects (PSOs) to eliminate shader compilation stutters, particularly important for Vulkan and Metal on mobile
Optimizing mobile game rendering for 60 FPS is a complex endeavor involving careful consideration of asset creation, rendering techniques, and shader design. If you’re interested in working on this, we’re hiring!