6 Performance optimization guide

6.1 Multi-scene Configuration Instruction

  1. After adding the Pvr_UnitySDK prefab to the scene, it is needed to delete Main Camera of Unity.
  2. If there are many scenes in the project, when the Pvr_UnitySDK prefab is put into the main scene, “DontDestroyOnLoad” method needs to be added for the prefab. This can guarantee that there exists only one Pvr_UnitySDK prefab when switching scenes.

6.2 Frame rate and scenes requirements

Frame rate:

The application frame rate for Pico G2, and G2 4K shall not be lower than 30 frames, and it is recommended to have more than 45 frames. The frame rate for Neo 2、Neo 3 should be more than 60 frames.

Scenes:

The triangular patch of the model being rendered in the camera view is controlled within 100,000

The amount of model vertices being rendered in the camera view is controlled within 100,000

The amount of common unity lights such as electric light sources is controlled within 50

The amount of ordinary unity particle systems is controlled within 50

Try to use the more efficient Unity shader

Examples of optimization methods:

Reduce the amount of fixed points on model faces when guaranteed to be displayed

Share the material and animation

Use a compressed texture format

Use as few lighting effects as possible

Use static batch processing

Optimize scripts to reduce complexity. Limit memory usage, CPU usage and other resource consumption

6.3 Advanced rendering methods

6.3.1 Foveated Rendering

Foveated rendering optimizes the ability to render scenes by providing high resolution for the center of the field of view, and greatly reducing peripheral views the details of the scene.

For more information, see: Chapter 8.7 Foveated Rendering.

6.3.2 VR Compositor Layers

VR Compositor Layers is more useful when rendering messages, text, videos which are used as “Focus of the Scene”. Meanwhile it can also be used for simple scenes and backgrounds.

For more information, see: Chapter 8.8 VR Compositor Layers.

6.3.3 Monocular Camera

Use a single image to render to both eyes, which effectively reduces rendering.

For more information, see: Chapter 8.9 Monocular Camera

6.3.4 SinglePass

SinglePass is based on native Unity SinglePass feature. It uses one camera to fulfill stereo rendering, reducing half of Draw Call and Occlusion Culling. Using this feature can increase frame rate dramatically in complex scenes. But SinglePass don’t support post processing. This option will take effect in all scenes.

For more information, see: Chapter 8.12 SinglePass

6.3.5 URP Configuration

For URP related information, please refer to https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@10.3/manual/whats-new/urp-whats-new.html.

Here, Unity 2019.4.2f1 is taken as an example.

  1. Open Window/Package Manager
_images/3.5.PNG

Figure 6.1 Window toolbar

  1. Select Show preview packages
_images/3.6.PNG

Figure 6.2 The advanced option of Packages

  1. Under “Universal PR” , click Install in the bottom right.
_images/3.7.PNG

Figure 6.3 Install the URP

  1. Create Universal Render Pipeline Asset
_images/3.8.PNG

Figure 6.4 Create URP Asset

  1. Use UniversalRenderPipelineAsset

Drag and drop the file created in step 4 to Scriptable Render Pipeline Setting field in Project Setting/Graphics

_images/3.9.PNG

Figure 6.5 Use URP Asset

  1. Replace materials in the project with URP materials
_images/3.10.PNG

Figure 6.6 Update materials in the project

6.4 Mitigate HMD overheating

  1. Check the current frame rate on VR application.

To turn on real-time display of frame rate using Pvr_UnitySDK, follow the instructions in Chapter 8.1 Display frame rate.

Another approach to enable real-time display of frame rate on the device. Go to 2D Settings -> System -> User configuration. Under Special Settings, turn on Info of the VR frame rate.

  1. Limit the frame rate in the Inspector panel of Pvr_UnitySDK and Chapter 8.3 Limited frame rate is for the reference.
  2. Enable Foveated Rendering. Setting the Foveation Level to High is recommended.