# Performance and Optimization

Good performance is a key factor to ensure users have a comfortable VR experience. We would like to share some useful guidelines and tips to help you optimize your Qiyu VR application.

First of all, Use the Unity Profile (opens new window) / QIYU Performance Tool to get CPU/GPU performance metrics and find out it is CPU-bound or GPU-bound.Then you can plan for a better optimization strategy accordingly.

Tips: Unity Profile can show the CPU time directly. If the CPU time is close to the time per frame(72 FPS means rendered each frame in 13.9ms ), then the application is CPU-bound, otherwise is GPU-bound.

# 1. CPU Optimization

# 1.1 Optimization of Scenes and Assets

  • There are not too many objects or high polygon models in the player's FOV.

  • Less than 100,000 triangles or vertices per frame.

  • Less than 100 draw calls per frame.

  • Use a compressed texture format. Combine the textures used in the scene into a single texture. Using this technique objects that share the same textures become eligible for batching.

  • Draw call batching (opens new window):

  1. Dynamic batching: for small enough Meshes, this transforms their vertices on the CPU, groups many similar vertices together, and draws them all in one go.
  2. Static batching: combines static (not moving) GameObjects into big Meshes, and renders them in a faster way.
  • Optimize scripts to reduce complexity.

  • Disable interaction and physics calculation that are not needed.

# 1.2 Use some Advanced Rendering Features

  • Select Single Pass Mode.
  • Scripting Backend: IL2CPP
  • Target Architectures: ARM64

# 2. GPU Optimization

# 2.1 Optimization of Scenes and Assets

  • Try to use the more efficient Unity mobile shaders instead of standard shaders.

  • Lighting

  1. Real-time lighting and reflection probes are expensive. Avoid using them if possible.
  2. Use as few lighting effects as possible.
  3. The amount of common unity lights such as electric light sources is controlled within 50.
  • Use live shadows carefully.

  • The amount of ordinary unity particle systems is controlled within 50.

  • Try to reduce translucent materials rendering and the number of alpha pixels.

# 2.2 Use some Advanced Rendering Features

  • Select Foveation Rendering Level you need.
  • Set "Eye Resolution Scale Factor" less than 1. (0.7 is recommended, please do not lower than 0.6, otherwise, the resolution will be too low to accept)
  • Occlusion Culling (opens new window) could be used to improve the runtime performance of your Project.
  • Pixel Light Count: 1
  • Anisotropic Textures: Per Texture
  • Anti Aliasing: less than 4x
  • Soft Particles: Disable
  • Real time Reflection Probes: Disable
  • Billboards Face Camera Position: Disable

# 3. Consumption Optimization

QIYU system charge the CPU, GPU resource and rate to ensure stable running of applications. Developers can follow the ways below to optimize application consumption.

# 3.1 Scenes and Resource Optimization

  • Texture Compression:ASTC