HoloKit Docs
Buy HoloKit
  • 🌟HoloKit Overview
  • Product
    • 💭Concepts
      • What's Stereoscopic AR?
        • Mixed Reality Spectrum
        • OST vs VST
      • Why We Design HoloKit X?
      • Why iPhone Only?
      • Journey of HoloKit X
    • đŸĨŊHoloKit X
      • đŸ› ī¸Technologies
        • 🤏Hand Tracking
        • đŸ“ŗHaptics Feedback
        • 📎App-less WebXR Browser
        • 🍏Apple Exclusive Technology
        • âąī¸Low-Latency 6DOF Spatial Tracking
        • 🔗Multipeer Connectivity
        • 🔊Spatial Audio and Audio Spatialization
        • đŸ™ī¸Environmental Understanding based on LiDAR
        • 👀Stereoscopic Rendering
      • đŸ•šī¸Input Methods
        • đŸ—Ŗī¸Speech Recognition
        • đŸ‘ī¸Eye Gazing
        • 🤏Hand Tracking
        • 👆TouchBar Control
        • 🎮Wireless Game Controller (Optional)
        • âŒ¨ī¸Wireless Keyboard (Optional)
        • ⌚Apple Watch (Optional)
        • đŸĒ„Arduino sensors (Optional)
      • 📃Specifications
      • 📱Compatible iPhones
      • 🎧Compatible Audio
    • 📲HoloKit App
      • 🎲Games and Demos
        • 🐉Dragon Hunting
        • đŸĒ„Wizard Duel
        • 🔤Typed Reality
      • âœˆī¸App-less WebXR Launcher
    • 📖How-to Instructions
    • ❓FAQs
  • Realities
    • Gallery of Realities
    • WebXR Gallery
    • For Creators
    • For Educators
    • For Researchers
    • Design New Reality
  • Creators
    • 🔌Unity SDK
      • Overview
      • Prerequisite
      • How to Get HoloKit Unity SDK
      • Stereoscopic Rendering
      • Hand Tracking
      • Advanced Use of Hand Tracking
      • Other Useful Tips
    • đŸ’ŧTutorials
      • đŸ‘¯Tutorial 5: Multiplayer AR
      • 💈Tutorial 4: Interact with holographical avatar with ChatGPT
      • 🌎Tutorial 3: Use Google Geospatial anchors to position real-world content
      • 🎡Tutorial 2: Use Immersal's Visual Positioning System for AR Exhibition
      • đŸ–ī¸Tutorial 1: Use Hand Tracking for Interacting with Holograms
    • 🛂Support
  • About
    • âšĒAbout us
    • đŸ‘ŧApply Evangelists for HoloKit
    • đŸ’ŦMedia Inquiry
      • đŸ—žī¸Media Coverage
        • HoloKit X Media Coverage
        • HoloKit 1 Media Coverage
      • 📄Fact Sheet
        • About the Company
        • About the Product
    • đŸĨ‡Awards
    • đŸ”ļMedia Assets
      • Branding Guidelines
        • Logo Guidelines
        • Logo for Partnership
        • Slogan
  • Legal
    • Terms
    • Use, Health & Safety Guideline
    • Shipping and Return Policy
    • Privacy Policy
    • Terms of Service
Powered by GitBook
On this page
  • Initialize HoloKit SDK
  • Setup HoloKit Camera
  • Add The Default HoloKit UI
  • Set Screen Orientation
  • Add a Cube
  • Build The Project
  1. Creators
  2. 🔌Unity SDK

Stereoscopic Rendering

PreviousHow to Get HoloKit Unity SDKNextHand Tracking

Last updated 1 year ago

*For guidance on the latest version, refer to the GitHub page.

Stereoscopic rendering is the core functionality provided by HoloKit SDK. It can transform a screen AR project into a stereo one by using the stereoscopic camera prefab provided by the SDK.

This section is a tutorial on how to implement the sample stereoscopic rendering project. You can directly import this sample by clicking the import button as shown below.

After you import the sample, you can have a look at the prefabs and scripts used in the sample scene.

If you want to build everything from scratch, please follow the rest of the section.

Initialize HoloKit SDK

There is a script called HoloKitDriver which initializes some fundamental functinalities at the beginning of the application life cycle. For any HoloKit project, we first need to drag the HoloKitDriver prefab into the scene. We can find the HoloKitDriver prefab in Packages->HoloKit SDK->Assets->Prefabs.

Setup HoloKit Camera

We first add ARSession and XROrigin objects into the scene as a normal ARFoundation project.

Then delete the MainCamera object under the XROrigin, and replace it with a HoloKitCamera prefab. You can find the HoloKitCamera prefab in Packages->HoloKit SDK->Assets->Prefabs.

After replacing, please make sure the Camera GameObject field of the XROrigin is assigned with the new HoloKitCamera.

Add The Default HoloKit UI

For a HoloKit application, it can switch between two render modes, which are Mono mode and Stereo mode. Under Mono mode, the app should look exactly like a normal screen AR app. Under Stereo mode, two viewports are rendered on the screen and you can insert your iPhone into a HoloKit to experience stereoscopic AR.

We need some basic UI to control the switching between two render modes. There is already a default UI canvas in the package which does the job. Go to Packages->HoloKit SDK->Assets->Prefabs->UI and find the HoloKitUICanvas prefab. Drag the prefab into the scene. Also add an EventSystem object into the scene thus we can press the button on the canvas.

If you are using Unity New Input System, don't forget to upgrade your EventSystem to fit it.

Set Screen Orientation

Under Stereo mode, the screen orientation is locked to be LandscapeLeft. Under Mono mode, the screen orientation is really up to you. It is exactly like a normal screen AR app. But in this tutorial, let's make things easy and lock the screen orientation to be LandscapeLeft.

Add a Cube

Believe it or not, you've done everything to setup a basic HoloKit application. The only problem is that there is no object in the scene so you cannot see anything. Let's add a cube into the scene and set its position to (0, 0, 5).

Build The Project

Now everything is ready. Build the project and you should see a cube in front of you. Press the upper-right button to switch to Stereo mode and insert your iPhone into a HoloKit. Put the HoloKit on and move around, you should see the cube fixed in that position.

Click the import button to import the stereoscopic rendering sample
Drag HoloKitDriver prefab into the scene
Add ARSession and XROrigin into the scene
Replace the default MainCamera with HoloKitCamera
A screenshot of HoloKit App under Mono mode
A screenshot of HoloKit App under Stereo mode
Add HoloKitUICanvas and EventSystem into the scene
Set Screen Orientation to LandscapeLeft in Project Settings
Add a cube into the scene