DirectPreview

Introduction

In the development process, repeatedly building APKs in Unreal is time-consuming. Direct Preview lets you skip the building process. You can preview in both Unreal Editor and your HMD device simultaneously.

Note

The rendering path for Android applications differs substantially from the rendering path used for game previews, and you may notice important differences in the look-and-feel and performance.

Architecture

../_images/Architecture_unreal.png

Direct Preview is separated into three parts:

  • dpServer

dpServer takes over the Unreal textures and the poses sent from wvr_plugins_directpreview.dll. And then, dpServer encodes these information and sends them to target device.

  • wvr_plugins_directpreview_agent_unreal.apk on your target device

There are 2 major tasks in wvr_plugins_directpreview_agent_unreal.apk.

  1. wvr_plugins_directpreview_agent_unreal.apk gets all data like pose, event and state of the HMD/controllers and sends to wvr_plugins_directpreview.dll via USB/Wifi.
  2. wvr_plugins_directpreview_agent_unreal.apk also takes over the images sent from dpServer, decodes the images, and displays the images on your target device.
  • wvr_plugins_directpreview.dll

Unreal editor will load wvr_plugins_directpreview.dll once you start VR preview. After initialization and connection, it provides all data (pose, event and state of device) from wvr_plugins_directpreview_agent_unreal.apk to Unreal which operates all routines and draws images on texture. After drawing texture is completed, wvr_plugins_directpreview.dll will send texture images from Unreal with corresponding pose data to dpServer.

Steps

  1. WaveVR > Plugin Settings

Find Direct Preview settings through the menu item “WaveVR > Plugin Settings”, or you can find it in Project Settings as well.

../_images/step1.png
  1. Direct Preview settings
../_images/step2.png
  • Connect Type
  • Select USB

    Get device information (pose, event, state) through USB. Instant preview can be seen in Unreal Editor, but not in the HMD.

  • Select Wi-Fi

    • Device Wi-Fi IP

      Fill in the HMD’s Wi-Fi IP.

    • Enable preview image

      • Check “Enable preview image”:

        Enable to present the corresponding effect according to the pose, event and state returned from the HMD, and enable to show the Unreal Game mode images in both Unreal Game mode and the HMD.

      • Uncheck “Enable preview image”:

        Enable to present the corresponding effect according to the pose, event and state returned from the HMD, and only display in the Unreal Game mode.

    • Render target device

    Developers need to assign which render target device is using.

    Note

    Render target is incorrect will cause streaming abnormal.

    Note

    Please re-install Device APK if you changed option of render target device.

  • Update frequency

    Choose how many images per second are sent to the HMD based on network conditions. Choose from: Runtime defined, 15 FPS, 30 FPS, 45 FPS, 60 FPS, and 75 FPS. When “Runtime defined” is selected, the FPS will be set to the default refresh rate of the HMD. If the HMD default refresh rate is not supported or doesn’t exist, Update frequency will be set to 75 FPS.

    Note

    FPS here means how many images dpServer sends to the APK, instead of the FPS shown in Unreal Editor.

  • Regularly save images

    Check “Regularly save images” to regularly get images from Unreal, and save them ( dp_unreal_image_number.jpg ) in the path D:/ .

Note

You can adjust the image size sent to the HMD by changing the window size in Editor Preference > Level Editor - Play in Unreal Editor.

../_images/WindowSizeSettings.png
  1. WaveVR > Install Device APK

Install wvr_plugins_directpreview_agent_unreal.apk to the HMD. Click on “Install Device APK” and it will automatically install the APK to the HMD and create a “config.json” in the path “/sdcard/DirectPreview” in the HMD.

  1. WaveVR > Start DPServer

Click on “Start DPServer” to start dpServer.

../_images/step51.png

After you clicked, a new window will be shown as below:

../_images/step5_ok.png
  1. WaveVR > Start Device APK

Start wvr_plugins_directpreview_agent_unreal.apk in the HMD.

  1. After dpServer is connected with wvr_plugins_directpreview_agent_unreal.apk, click on the “VR Preview” button in Unreal Editor to preview instantly.
../_images/VRPreview1.png
  1. WaveVR > Stop Device APK

Stop running the APK in the HMD.

../_images/step7.png
  1. WaveVR > Stop DPServer

Stop dpServer.

../_images/step8.png

Note

Before closing the Unreal Editor, please make sure “VR Preview” is turned off in Unreal.