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 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.
Optimize Script, reduce the complexity of codes and algorithm.
Avoid using unnecessary interactions and physical calculations.
Avoid placing too many objects and high polygon models in the field of view.
Try to share materials and animation resources.
Try to use compressed texture format.
Try to use static batch processing.
High triangle count: it is recommended to locate 750000 to 1000000 triangles, which are the total per frame. From level geometry to characters, particle effects and even UI elements.
Complex facial animation: complex facial animation will increase the computational cost. It is recommended to use the properly designed denatured skeleton of layered bone LOD when only a few facial settings with complete details are given.
Cloth and hair / fur: real time cloth physics are expensive and perform poorly at lower resolutions. Any items of real cloth dynamic calculation should be carefully considered. If it is not very important, similar items such as long and drifting skirts or curtains can be avoided as far as possible. The same is true for hair and fur effects, which can be slightly stylized.
Dense leaves: a relatively simple optimization is to try to avoid dense leaves in the environmental design.
Dynamic shadow: the performance overhead of dynamic shadow is huge. The calculation of each frame will bring a great burden to CPU and GPU, and it is often necessary to re render the scene multiple times in one frame. You can achieve significant performance improvement by relying on static ambient lighting.
Full screen effect: for example, motion blur and real-time ambient light masking require a large amount of pixel throughput. Use these functions with caution.
Minimize the number of renderings for translucent materials.
Profiler Tool helps developers collect, analyze, and visualize data emitted real-time. QIYU device can connect with PC by using wire or wireless methods. Please refer to the details of Epic documents:
Unreal Insights is same as Unreal Profiler Tool, but more stable. QIYU device can connect with PC by using cable or TCP. This tool can monitor the QIYU application status in real-time and helps developers identify bottlenecks and collect, analyze, and visualize data emitted. Please refer to the details of Epic documents:
The Unreal Insights tool ships with Unreal Engine, located in:\UnrealEngine\Engine\Binaries\Win64\UnrealInsights.exe
Settings:
To install and develop the application, you need to start the game for the first time before the binary file can create its associated UE4 project directorys.
/sdcard/UE4Game/
Setup TCP connection by using adb commands (Unreal Insights listens on TCP port 1980)
adb reverse tcp:1980 tcp:1980.
Modify file: UE4CommandLine.txt
In the engine file, you can find the template file at:
\UnrealEngine\Engine\Build\Android\UE4Game
Copy and delete the extension
UE4CommandLine.txt.template.template
Paste the file to the project root directory. UE4CommandLine.txt
adb push UE4CommandLine.txt /sdcard/UE4Game//
Description:
- UE project name. This will match with the name in device. /sdcard/UE4Game/
- UProjectName Will match the output binary (described by the engine), so just using the APK name or lthe file in the game directory .uproject。
- Optional, this allows to customize the startup parameters based on each mapping. If you know the name of the map, you can put it here.
Note: If you have a scene in use, you can set up tracking only for the map so that the tracking overhead does not affect other analyses on a regular map. Because you can keep the startup parameter file in the same location without having to delete or rename it between startup types.
-trace- Allows to customize the channel to enter for tracking. The following are some combinations used in the analysis:
Most detailed / most expensive log,counters,cpu,frame,bookmark,file,loadtime,gpu,rhicommands,rendercommands,object.
Main content / minimum overhead -counters, cpu, frame, bookmark, gpu.
-statnamedevents- When used in conjunction with options, this activates more CPU timing events -trace=cpu.
-tracehost- IP address of the host with the running unreal listening instance to connect to (127.0.0.1).
-tracefile- Used to define the local path on the device to dump files to as an alternative to real-time analysis. You can keep it in a static location and overwrite it every time to always keep the latest trace .trace。