Skip to content

Latest commit

 

History

History
133 lines (94 loc) · 6.75 KB

metaxr.md

File metadata and controls

133 lines (94 loc) · 6.75 KB

HISPlayer MetaXR Integration

Integrate Meta XR All-in-One SDK

Integrate HISPlayer SDK with the Meta XR All-in-One SDK.

First, please configure the Unity project for Oculus by following this Tutorial and open Window > Package Manager > Packages: In Project to check Meta XR All-in-One SDK is installed properly.

image

Requirements

Meta XR All-in-One version

  • Minimal Meta XR All-in-One version: 60.0

Unity version

  • Minimal Unity version: 2021.3.26f1

HISPlayer SDK version

  • Minimal HISPlayer SDK version: 3.3.0

Supported Android Version

  • Minor version - Android 10.0 ‘Quince Tart’
  • Minimum SDK: 29

Supported Unity Color Space

  • Linear

Target Architecture

  • IL2CPP - ARM64

Oculus platform

Open Edit > Player Settings > MetaXR, select the Android platform and clik "Select All" and "Apply All" in order to set up all the Oculus settings.

image

Select XR Plug-in Management, please make sure that you have the Oculus option checked. Otherwise, when you run the application, it will show a 2D window without XR environment.

  • Edit > Project Settings > XR Plug-in Management
image

Import HISPlayer SDK

If you have not imported HISPlayer SDK yet, please follow the Quickstart Guide.

Import HISPlayer Meta XR Sample

Please, download the sample here: HISPlayer MetaXR 360 Sample (no need to download it if you have received it in the email). The sample is intended for playing 360 video.

Before using the sample, please make sure you have followed the above requirements to set-up your Unity project for Oculus and HISPlayer SDK. To use the sample, please follow these steps :

  • Set up the Meta XR All-in-One environment
  • Import HISPlayer SDK
  • Import HISPlayer Meta XR Sample
  • Open Assets/HISPlayerOculusSample/Scenes/HISPlayerOculusSample
  • Input the license key through the Inspector Unity window: StreamController GameObject > HISPlayerSample component > License Key
  • Open File > Build Settings > Add Open Scenes
  • Build and Run

To check how to set up the SDK and API usage, please refer to Assets/HISPlayerOculusSample/Scripts/Sample/HISPlayerSample.cs and StreamController GameObject in the Editor.

To check more about the project explanation, please refer to Assets/HISPlayerOculusSample/README.pdf

HISPlayer Oculus Controllers

image

HISPlayer 360 Material

Unity provides ways to configure how you will display your video content on the 360 environment. Please, refer to the following Unity documentation to check what kind of settings you will need: Unity Video Panoramic Tutorial.

We provide a material to configure the options of your video so please, refer to Assets/HISPlayerOculusSample/Resources/RenderTextures/Materials/HISPlayer_360_Material.material to check the 360 settings.

In our sample we're using the following options:

  • Mapping: Latitude Longitude Layout
  • Image Type: 360 Degrees
  • 3D Layout: None

image

180 Degrees Video Playback

For 180 degrees playback usage, please change the Image Type of the material (HISPlayer_360_Material.mat) to 180 Degrees.

image

HISPlayer 360 Shader for Linear Color Space

If you are using HISPlayer SDK version 3.4.0 and above, you will find HISPlayer360Shader.shader for 360 video playback in Packages/com.hisplayer.hisplayersdk/HISPlayer/Scripts/Shaders/.

image

HISPlayerOculusSample uses the default Unity Skybox/Panoramic shader, as explained in the HISPlayer 360 Material.

If you use Linear Color Space in the Unity Project Settings > Player Settings > Other Settings > Rendering > Color Space, please change the default shader to HISPlayer360Shader which will improve the video rendering quality by following these steps :

  • Open Assets/HISPlayerOculusSample/Resources/RenderTextures/Materials/HISPlayer_360_Material.mat

image

  • In the Inspector window, change Shader to HISPlayer360Shader

image

  • Make sure you have the following setting of the material:

image

Vertically Inverted Video Issue

If you face an issue where the video is vertically inverted or rendered upside down, please follow 1 of these 2 approaches:

  • Approach 1 (Recommended): Use HISPlayer360Shader.shader and attach it to the material as explained in the previous section. Make sure that the Flip Vertically option is enabled.

image

  • Approach 2: Set FlipTextureVertically of the StreamProperties to true before calling SetUpPlayer() in your project script. This API will flip the texture vertically. This API will work only for Android and Meta Quest devices, it will not have effect in the Unity editor. For example:
    // Flip texture vertically to render the texture correctly for Skybox material.
    multiStreamProperties[0].FlipTextureVertically = true;
    SetUpPlayer();
    

Please don't mix both approaches, otherwise the video will be veritcally inverted.