Skip to content

Latest commit

 

History

History
111 lines (78 loc) · 6 KB

hisplayer-oculus-360-sample.md

File metadata and controls

111 lines (78 loc) · 6 KB

HISPlayer Oculus 360 Sample (Deprecated)

Oculus Integration

Integrate HISPlayer SDK with the Oculus environment.

The Meta XR All-in-One SDK is available since November 13th, 2023, but in this tutorial we will explain how to use the old OculusIntegration.unitypackage.

First, please configure the Unity project for Oculus by following this Tutorial. In the Step 4. Import Meta XR All-in-One SDK from the Unity Asset Store, please, import the Oculus Integration package instead and accept all the pop-ups in order to config properly the SDK.

  • Assets > Import Package > Custom Package > OculusIntegration.unitypackage

Step 1

Requirements

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 > Oculus, select the Android platform and clik "Select All" and "Apply All" in order to set up all the Oculus settings.

image

In 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 Oculus Sample

Please, download the sample here: HISPlayer Oculus 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 :

  • Import Oculus Integration SDK
  • Set up the Oculus environment
  • Import HISPlayer SDK
  • Import HISPlayer Oculus 360 Sample
  • Open Assets/HISPlayerOculusSample/Scenes/HISPlayerOculusSample
  • If you received a license key from HISPlayer, 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