# 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 recommand 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. FR can dramatically increase performance, improving the image show in the headset.

Fig 3.2.1 Foveation Rendering Model and Parameters

Three 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.25、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 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
    • Not support FFR
    • The MSAA 4x and 8x do not work when using MultiView

# 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.

4.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 provide 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
Manufacturer iQIYI Smart iQIYI Smart
Headset QIYU 3 QIYU Dream
Left Controller QIYU 3 Left Controller QIYU Dream Left Controller
Right Controller QIYU 3 Right Controller QIYU Dream Right Controller

QIYU SDK provides the controller models of QIYU 3 and QIYU Dream, developers can find in Meshes folder, please refer to the screenshot below.

# 3.9 Stereo Layer Component

Compositor layers let you 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.