# 3. Function Introduction

# 3.1 Eye Resolution Scale

Developer can modify the value of RenderTexture, which depends on the scene's needs, the default value is 1 (Recommended). The value less, the resolution will be lower, but FPS will be enhanced and the power consumption will be reduced; On the contrary, if the value increased, the resolution will be enhanced, but FPS will be reduced and the power consumption will be increased. Moreover, the maximum value should not larger than 1. Developer can modify the "Pixel Density" by using the vr.pixelDensity from UE. We provide two ways to use the API:

  1. Set by Blueprint

Use "Execute Console Command" node to modify the "vr.pixeldensity 1.0" command (Please note the Space). We recommend that call it after the blueprint "EventBeginPlay" .

3.1.1 Tracking Origin Blueprint
  1. Set by ini

Open the Path: Project/Config/DefaultEngine.ini,and add "vr.pixeldensity=1" under “[/Script/Engine.RendererSettings]” tag, please refer to the picture below:

3.1.2 DefaultEngine.ini

The UE official document address:https://www.unrealengine.com/en-US/blog/significant-changes-coming-to-vr-resolution-settings-in-4-19?lang=en-US (opens new window)

Note: The"Plugins-QIYU-SDK-Eye Resolution Scale" of the old versions SDK has been deprecated.

# 3.2 Foveation Rendering

Foveated rendering can optimize 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. This reduces the GPU load as a result of the reduction in pixel shading requirements. FFR can dramatically increase performance, improving the image show in the headset.

Fig 3.2.1 Foveation Rendering Model and Parameters

There are three modes: Low, Med and High can be selected. The higher the Foveation Level, the higher the FPS, but the more the pixel loss, which will affect the clarity of the edge area, please choose the appropriate Level according to the rendering needs. Developers can also set the fixation rendering level and parameters through the configuration panel.

Fig3.2.2 FFR Setting
  • In addition, the Foveation Rendering Level and parameter can be set by the following blueprint API:
Fig3.2.3 Set Foveation Rendering Level
Fig3.2.4 Set Foveation Rendering Parameters

# 3.3 Multi View

With Multi View, objects are rendered once to the left eye buffer, then duplicated to the right buffer automatically with appropriate modifications for vertex position and view-dependent variables such as reflection. It primarily reduces CPU usage, and the GPU performance is unchanged largely. If your application is CPU-bound or draw call bound, we strongly recommend using Single Pass Stereo rendering to improve performance.

Qiyu SDK supports the Mobile MultiView function of Unreal Engine,it can be enabled by check Mobile Multi-View, the path is Project Setting > Rendering > VR > Mobile Multi-View.

Fig3.3 Enable MultiView

Please note that after click or unclick this function, please restart the engine to adapt the settings. Moreover, before enable the Multi View, please turn off the Mobile HDR function.

# 3.4 Vulkan

Vulkan is a high performance and low CPU Utilization graphics APIs, which inherits OpenGL ES. It’s also important to remember that Vulkan, as well as graphics APIs in general, is a CPU API that controls the GPU, so any performance benefits that you might derive from Vulkan will only be of rendering CPU performance, not of GPU performance.

Because of the difference version of Unreal engines, there are different to enable the Vulkan. We suggest developers to use Unreal 4.27 to use Vulkan to develop the game.

  • Unreal Engine 4.26
  1. Use the source code of Unreal engine, and change part of it.

Modify the function of IsStandaloneStereoOnlyDevice at EngineSourcePath\Engine\Source\Runtime\Core\Private\Android\AndroidPlatformMisc.cpp as the following below:

bool FAndroidMisc::IsStandaloneStereoOnlyDevice()
{
  // Oculus HMDs are always in stereo mode
  if (FAndroidMisc::GetDeviceMake() == FString("Oculus"))
  {
   return true;
  }
#if USE_ANDROID_JNI
  extern bool AndroidThunkCpp_HasMetaDataKey(const FString& Key);
  if (AndroidThunkCpp_HasMetaDataKey(FString("android.device.bQiyuPlatform")))
  {
   return true;
  }
#endif
  return false;
}

Please refer to the reference for Unreal 4.26:

https://docs.unrealengine.com/4.26/en-US/ProgrammingAndScripting/ProgrammingWithCPP/DownloadingSourceCode/ (opens new window)

  1. Check Support Vulkan and uncheck the SupportOpenGL ES3.1 at Project Settings->Android -> Build.

Fig3.4 Enable Vulkan

Note: The C++ type project is recommended.

  • Unreal Engine 4.27

Using the installing standard Unreal engine with the following settings:

  1. Check Support Vulkan and uncheck the SupportOpenGL ES 3.1 at project settings->Android -> Build.

  2. Close all the VR plugins (including OpenXR) except QIYU.

  • Known Issue

    • The frame rate of Vulkan will be lower in the complex scenes
    • Not support HDR
    • The MSAA 4x and 8x do not work when using MultiView
    • Unreal Engine 4.25 is not support Vulkan

# 3.5 Tracking Origin Mode

Sets the tracking origin type.

Eye: use the headset position and direction as a reference for tracking, and recenter will restore the position of the virtual camera

Floor: take the ground detected by the headset as the reference plane for tracking, and recenter will not change the height of the virtual camera

Set Floor Eye Type can be used directly in the blueprint.

3.5 Tracking Origin Blueprint API

# 3.6 VR Loading Screen

The loading Screen of Unreal Engine is not in VR mode. To improve the user experience, QIYU provides a DIY VR loading Screen function. Please following the steps below:

  1. Compress the loading picture to "loading.zip", replace the loading.zip file in Plugins\QIYUVR\Source\QIYUVRLib\Libs\Android\assets. The file requirements:
  • The name of zip file must be "loading.zip".
  • The format of loading pictures must be PNG.
  • The aspect ratio of loading pictures should be 1:1.
  • If compressing more than one picture, it can achieve animation effect.
  1. Enable the Loading Screen in SDK.
Fig3.6.1 Enable Loading screen
Fig3.6.2 Switch Loading Screen
  1. Uncheck the "Show Launch Image". The path to the function is Project Setting > Platform > Android > Launch Images.
Fig3.6.3 Turn off the Unreal Engine LoadingScreen

# 3.7 Boundary Blueprint

Function Blueprint Introduction
GetBoundaryGeometry Get Boundary the value of (X, Y, Z)
GetBoundaryDimensions Get the boundary Dimensions
SetBoundaryChangeDelegate Set boundary Change Delegate (set the point which used to get the boundary change)

# 3.8 Device

  • Get the name and manufacturer of QIYU device
Device QIYU 3 QIYU Dream QIYU Dream Pro QIYU MIX Other QIYU Device in Future
Manufacturer iQIYI Smart iQIYI Smart Dreamagic Dreamagic Dreamagic
Headset QiyuHMD-3 QiyuHMD-Dream QiyuHMD-DreamPro QiyuHMD-MIX QiyuHMD
Left Controller Qiyu Controller-Left-3 Qiyu Controller-Left-Dream Qiyu Controller-Left-Dream Qiyu Controller-Left-MIX Qiyu Controller-Left
Right Controller Qiyu Controller-Right-3 Qiyu Controller-Right-Dream Qiyu Controller-Right-Dream Qiyu Controller-Right-MIX Qiyu Controller-Right

QIYU SDK provides the controller models of QIYU 3 ,QIYU Dream and QIYU MIX (Dream and Dream Pro have same controller models), developers can find in Meshes folder, please refer to the screenshot below.

# 3.9 Stereo Layer Component

In order to improve the rendering clarity of text, pictures, videos and other resources, the graphics and image areas that need high-definition display can be rendered through stereolayer.

StereoLayer allows you to render certain forms of content such as text, video, or textures with higher quality than traditional eye-buffer rendering can achieve. Because this will increase the system load, using more than 5 overlay or underlay is NOT recommended.

  • Stereo Layer Settings

To use the stereo layer and VR Pawn together, please follow the steps below:

  1. Open up the Pawn that you want to use Stereo Layers with and then go to the Viewport panel.
  1. Click on the Add Components button from the drop-down list that is displayed and search for the Stereo Layer Component.
  1. Now drag the Stereo Layer Component on top of the Pawn's camera to make it a child actor of the camera.
  1. Select the Stereo Layer Component from the Components list and then in the Details Panel under the Transform section, set the X value of Location to 100 so that it is easy to see in QIYU device.
  1. In Stereo Layer, setting Stereo Layer component corresponding properties

After completing the above steps, you can normally view the stereolayer component in the all-in-one machine, which is not displayed on the PC platform.

  • Stereo layer attribute description

The SDK supports the following attributes:

Name Description
Support Depth True if the stereo layer needs to support depth intersections with the scene geometry, if available on the platform.
Texture Texture displayed on the stereo layer (if stereoscopic textures are supported on the platform, and more than one texture is provided, this will be the right eye).
Stereo Layer Type Specifies how and where the quad is rendered to the screen.
StereoLayerShape Specifies which type of layer it is. Note that some shapes will be supported only on certain platforms.
Priority Render priority among all stereo layers, higher priority render on top of lower priority.

Description:

  • Stereo Layer Type: only support FaceLock and WorldLock in SDK at the moment, the effect of TrackerLock is same as FaceLock.

    • FaceLock: the relative position between Stereo layer and Camera is constant, and the stereo layer will be rendered in the fixed position.

    • WorldLock: Stereo layer in world is constant.

  • StereoLayerShape: SDK only supports Cylinder Layer and Quad Layer。

    • Cylinder Layer: This type is cylindrical surface. Developers can adjust the radius of the cylindrical surface through the Radius attribute, the arc length of the cylindrical surface through the Overlay Arc attribute, and the height of the cylindrical surface through the Height attribute.

    • Quad Layer: This type is Quad. Developers can adjust the length and width of the Quad through the Quad size property.

Note: SDK does not support the attributes are not listed in the table above.

# 3.10 3-Dof

QIYU SDK provides 3-Dof selection and blueprint APIs, which added "Neck model" and "Arm model", It can simulate the movement of head and hand naturally.

Developer can check the “TrackingRotationOnly” project settings->Plugin -> QIYU to enable 3Dof function before

If you need to dynamically switch the 3/6dof mode during operation, you can obtain the current tracking mode and set the tracking mode through the following two interfaces.

# 3.11 Display Refresh Rates

The display refresh rate stands for the VR device refreshing every second. The value of Display Refresh Rates higher the higher FPS and definition are supported and it will more stable for tracking. The default display Refresh Rates of QIYU devices is 72 Hz, in other words, the application will refreshing at 72 Hz if developers do not set or modify the value which can be set by using the following APIs.

It is worth to pay attention, higher display refresh rates requires less time for each frame, the application should make sure the performance is meet the QIYU Application review guidelines, otherwise, the application might be lived on QIYU store. Please refer to the Display refresh rates support by different types of QIYU devices:

Device Display Refresh Rates
QIYU 3 72Hz
QIYU Dream 72Hz
QIYU Dream Pro 72Hz, 90Hz
QIYU MIX 72Hz, 90Hz
  1. Get Available Display Refresh Rates List

​ Refresh Rates: Get available display refresh rates list.

​ Return Value: Return whether success, True: Get success, False: Fail.

  1. Get Display Refresh Rate

​ Display Refresh Rate:Get display refresh rate.

​ Return Value: Return whether success, True: Get success, False: Fail

  1. Set Display Refresh Rate

​ Display Refresh Rate: Set Display Refresh Rate

​ Return Value: Return whether success, True: Get success, False: Fail.

# 3.12 SetColorScaleAndOffset

This API is used to set the color scale and offset of scenes and all the layers, you can call the API as the following blueprint or C++.

Blueprint APIs:

C++:

staticvoidUQIYUVRHMDFunctionLibrary::SetColorScaleAndOffset(FLinearColorColorScale,FLinearColor ColorOffset,boolbApplyToAllLayers);

Description:

Color Scale: Color scale

Color Offset: Color offset

bApplyToAllLayers: Whether to apply to all layers. (if true, the effect will be applied to all underlay and overlay. If false, the effect will only be applied to the scene, and underlayer and overlayer will not be affected).

Note:

  1. Adjusting the alpha value may affect the display of underlay. It is recommended not to modify the alpha value when using underlay.

  2. Adjusting the alpha value will increase rendering power consumption. It is recommended to modify it as needed.

# 3.13 PC Direct Preview

To improve the porting efficiency and prevent to build the package many time during the developing, PC direct preview will provide a function running the scenes in Unity Editor, and you can also see the running views on the headset.

  • PC Configuration:

    • OS: Windows10 and above

    • Graphics: NVIDIA GeForce GTX 1060 / AMD 5700

    • CPU: Intel Core i7-6700 / AMD FX 8320 or above

    • Memory: 8G and above

  • Method:

  1. Use USB cable to connect PC and headset.

  2. install the QiyuPreviewAgent.apk to headset, please download at https://static-d.iqiyi.com/lequ/20220620/QiyuPreviewAgent_v1.0.0.rar.

  3. Pressing Qiyu Tool - Open preview tool, open the configuration panel, please adjust settings as need, and refer to the following description.

  4. Pressing "connect preview APP", write into configuration file and enable preview agent application.

  5. Pressing "VR Preview" to PLAY the project in Unreal Editor.

  6. The synchronous display of the scene will be shown both in PC and Headset.

  • Description for Settings
    1. Connect Type: USB connection is only accepted at the moment.
    2. IP Port: Data forwarding port of computer and all-in-one machine. If it is not necessary, this configuration item does not need to be modified.
    3. Render Frame: The frequency of the computer sending data to the all-in-one machine controls the display frame rate of the all-in-one machine, so the rendering frame rate of the computer is not consistent with the display frame rate of the all-in-one machine.
    4. Render Resolution: Rendering resolution, monocular size of eyebuffer used for engine rendering and all-in-one display. The higher the rendering resolution, the clearer the display effect and the lower the frame rate. Please balance the weight of frame rate and sharpness and choose the appropriate rendering resolution.
    5. Default Aspect Ratio: Whether to apply the rendering resolution to the window size of VR preview.
    6. Adb Path: In SDK, you can find the environment variable Android of PC_ Home to locate the ADB application. If the development machine is not configured with this environment variable, you can use this function to execute the native path of adb.exe.

Note: Each time the editor VR preview runs the scenario, please click the "connect preview app" button to ensure that the configuration takes effect normally and the all-in-one preview agent application starts normally.