The demo scenes use external libraries to enable basic movement controls, integrated VR rendering, and ARKit support.
Please read the instructions below for your particular use case!!
The ARKit Demo uses the ARKit asset from unity which you can download for free here:
To correctly use ARKit follow these steps.
- Import the Unity ARKit Plugin. Do this BEFORE importing Pocket Portal.
- Import
Pocket Portal
- Open the ARKit Demo scene in
Pocket Portal/Demo/Scenes
- Open
Window -> Portal State Manager
and switch toARKit (Apple Only)
- Build and run the demo using the iOS target. (Make sure to add open scenes).
- Run your project on an ARKit supported device (A9 / A10 processor, iPhone 6s and up).
- Move your device around slowly to detect the ground plane. Once it's detected you can tap to place the portal & other dimesion at the correct location for your demo.
Note: ARKit uses a greenscreen to composite the real world at the far camera plane, this means that skyboxes are not currently supported. My best advice is to use a "fake" skybox like in the ARKit demo scene as a work around. A 360 video sphere works too!
The FPSDemo uses a FPS Controller from Unity standard assets. To run this scene you'll need to download this asset through the unity menus:
Assets -> Import Package -> Characters
Once that's completed, make sure you are in the window / mac standalone build and run the Unity Scene.
Note: The other build settings (iOS for example) don't support controlling the FPS Character from the keyboard.
The SteamVRDemo uses the Steam VR Camera rig from the Steam VR Asset package which you can download for free here:
- Import the Steam VR Asset
- Import
Pocket Portal
- Open
Window -> Portal State Manager
and switch toSteam VR
- Run your project with your Vive or Rift connected!
Note: Make sure to add a skybox component to your main camera if you want to define custom skyboxes for different dimensions.
VRTK Kit allows you to quickly swap between Steam VR and the OpenVR frameworks. Steam VR works on Vive and Rift, while OpenVR (Occulus Utilities) are Rift only.
- Open the demo scene
VRTKKit demo
. - Load your preferred framework and make sure it shows up correctly in the VRTK_SDK Manager.
- Tag your controllers
[VRTK_Scripts]/LeftController
and[VRTK_Scripts]/RightController
and set that tag in the "Ignore Rigidbody Tag" if you'd like to manipulate your portal with touch controllers. This will keep the portal from deforming away from your controllers.
You may need to reimport the [VRTK_SDK MANAGER]
to ensure that your scene runs correctly. Make very sure to follow the steps below if this is the case.
- Make sure to set the Portal
MainCamera
to theeyes
camera inside of SteamVR. - Add a skybox to your eyes camera.
- Add the "GearCameraRenderInfo" to your
CenterEyeAnchor
camera inside of OcculusVR. - Make sure to set the Portal
MainCamera
to theCenterEyeAnchor
inside of OcculusVR. - Add a skybox to your eyes camera.
NOTE: Make sure to add a skybox component to your main camera if you want to define custom skyboxes for different dimensions.
The GearVRDemo uses the Open VR Camera rig from the Open VR API package which you can download for free by selecting "Oculus Utilities for Unity 5":
- Download the API
- Import
Pocket Portal
- Setup your Android Device for Gear VR development.
- Open
Window -> Portal State Manager
and switch toOpen VR
- Build and execute the
GearVRDemo
in Pocket Portal.
If you demo a VR scene, you'll also need to enable support for that particular library by opening
Window -> Portal State Manager
and selecting your platform.
The best way is to use one of the demo scenes and copy assets around, but if you'd like to set up your own, the steps are below.
The 'Dimension' script is added to objects to define many worlds coexisting in the same space, but only accesible through portals. The easiest way to create one is to use a demo scene, but if you'd like to make one from scratch.
- Create an empty game object.
- Add the 'Dimension' component to it.
- Set 'Initial Dimension' to true if you'd like your player to start in this dimension.
- Add your main camera as a child of the Initial Dimension object.
NOTE: The dimensions use the last layers in your layer mask, so if you are using all 32 layers they will not work.
The 'Portal' script is responsible for rendering to another dimension and allowing you to transition between dimensions.
- Grab a portal from the Portal-Prefabs folder and add it to your scene.
- Inside the prefab, there is an object called 'portal' that contains the portal script components.
- Make sure the 'main camera' variable is set to your main camera.
- Set 'Dimension 1' and 'Dimension 2' to the dimensions you'd like to connect with the portal.
NOTE: Make sure to add a skybox component to your main camera if you want to define custom skyboxes for different dimensions.
The portal code works in both normal and stereo (VR) camera modes. If you are using Steam VR setup is identical to above with one caveat.
- Make sure to use the 'eyes' camera as your main camera in the portal "Main Camera' variable.
- Add a skybox to your eyes camera.
- Tag your controllers and set that tag in the "Ignore Rigidbody Tag" if you'd like to manipulate your portal with touch controllers. This will keep the portal from deforming away from your controllers.
NOTE: Make sure to add a skybox component to your main camera if you want to define custom skyboxes for different dimensions.
The portal code works in both normal and stereo (VR) camera modes. If you are using Gear VR (or Rift) setup is identical to above with a couple of additional steps.
- Make sure to use the 'CenterEyeAnchor' camera as your main camera in the portal "Main Camera' variable.
- Add the "GearCameraRenderInfo" to your 'CenterEyeAnchor' camera.
- Add the "GearGrabObject" component to your 'CenterEyeAnchor' camera.
- Add a skybox to your 'CenterEyeAnchor' camera.
NOTE: Make sure to add a skybox component to your main camera if you want to define custom skyboxes for different dimensions.
VRTK Kit allows you to quickly swap between Steam VR and the OpenVR frameworks. Steam VR works on Vive and Rift, while OpenVR (Occulus Utilities) are Rift only.
- Open the demo scene
VRTKKit demo
. - Load your preferred framework and make sure it shows up correctly in the VRTK_SDK Manager.
- Tag your controllers
[VRTK_Scripts]/LeftController
and[VRTK_Scripts]/RightController
and set that tag in the "Ignore Rigidbody Tag" if you'd like to manipulate your portal with touch controllers. This will keep the portal from deforming away from your controllers.
NOTE: You may need to reimport the [VRTK_SDK MANAGER]
to ensure that your scene runs correctly. Make very sure to follow the steps below if this is the case.
- Make sure to set the Portal
MainCamera
to theeyes
camera inside of SteamVR. - Add a skybox to your eyes camera.
- Add the "GearCameraRenderInfo" to your
CenterEyeAnchor
camera inside of OcculusVR. - Make sure to set the Portal
MainCamera
to theCenterEyeAnchor
inside of OcculusVR. - Add a skybox to your eyes camera.
NOTE: Make sure to add a skybox component to your main camera if you want to define custom skyboxes for different dimensions.
If you have any additional questions or comments, please contact me directly at andrewzimmer906@gmail.com and I'll do my best to help you out.
Cheers!