6 Performance optimization guide¶
6.1 Multi-scene Configuration Instruction¶
- After adding the Pvr_UnitySDK prefab to the scene, it is needed to delete Main Camera of Unity.
- 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:
Frame rate for G2 4K should be no less than 30 frames and more than 45 frames is recommended. Frame rate for Neo 2 should be more than 60. Frame rate for Neo3 should be 72.
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.
- Open Window/Package Manager
Figure 6.1 Window toolbar
- Select Show preview packages
Figure 6.2 The advanced option of Packages
- Under “Universal PR” , click Install in the bottom right.
Figure 6.3 Install the URP
- Create Universal Render Pipeline Asset
Figure 6.4 Create URP Asset
- Use UniversalRenderPipelineAsset
Drag and drop the file created in step 4 to Scriptable Render Pipeline Setting field in Project Setting/Graphics
Figure 6.5 Use URP Asset
- Replace materials in the project with URP materials
Figure 6.6 Update materials in the project
6.4 Mitigate HMD overheating¶
- 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.
- Limit the frame rate in the Inspector panel of Pvr_UnitySDK and Chapter 8.3 Limited frame rate is for the reference.
- Enable Foveated Rendering. Setting the Foveation Level to High is recommended.
6.5 Recommended Project Settings configuration¶
6.5.1 Please refer to: Chapter 3.3 Unity Project Settings recommended configuration¶
6.5.2 Recommended Configuration for Quality Settings¶
Pixel Light Count:1
Texture Quality:Full Res
Anisotropic Textures:Per Texture
Anti Aliasing:2x
Soft Particles:Disable
Realtime Reflections Probes:Disable
Billboards Face Camera Position:Disable
6.5.3 Recommended Configuration for Quality Settings¶
Scripting Backend:IL2CPP
Target Architectures:ARM64
6.6 Recommended Settings for UI Clarity¶
The following content is the best practice of Pico team. To mitigate the blurring or flickering of some UI components, we suggest you adjust the value of Dynamic Pixels Per Unit in the Canvas Scaler in accordance with the following formula.
Figure 6.7 Canvas Scaler
Formulas for Recommended Settings:
L=distance*tan(fov/2)*2
N=1/Scale
PPU=EyeBuffer/(L*N)
Notes:
Distance - the distance between Canvas and Camera
Fov - Field of View (the default Fov of G2 4K series and Neo 2 is 101 degree,Neo 3 is 98 degree)
Scale - the Scale value of the current Canvas
EyeBuffer - RenderTextureSize for the current setting