Unity Tutorial -- Quest 2 Passthrough with VRIF

Опубликовано: 11 Октябрь 2024
на канале: James Clark (Long Live Geek)
1,707
41

My step by step directions on how to create a Passthrough experience for you Quest 2 using Unity. I also use Virtual Reality Interaction Framework, because it give me a little more control. (Note: After some more research, I realized that my character models were reducing my FPS to about 30 when I looked at them. The good news, is that there is a workaround that I was able to get 90FPS using. I'll share those details in a video very soon).

Required Assets
Unity version 2020 or Later
Oculus Integration (Updated)
VR Interaction Framework
XR Plugin Manager
Oculus XR Plugin


Switch Platform to Android
Time switched to 1/90
(Quality) VSync on Don’t Sync
XR Plugin Management set to Oculus, set the PC tab to Oculus also so that you can test before build.
(Player)
Color Space Linear
Multithread Rendering off
Minimum API level of 26
IL2CPP backend
ARM 64
Under the Oculus tab, go to Sample Framework, Usage, Passthrough, Scenes, Augmented Objects Scene. Make a copy, and use that as a base for your AR scene.
Under VRIF drag an XR Rig Advanced into the scene.
Create a floor. If you want to walk around your house, make sure to make the floor big. Uncheck Mesh Renderer so you’re not seeing a floor in VR. If you use AI, you will need to check Mesh Renderer when you Bake, then you’ll have to uncheck it again.
Add the following components to your XR Rig Advanced: OVR Camera Rig, OVR Manager, OVR Headset Emulator, and OVR Passthrough Layer.
On OVR Manager, Check Passthrough Capabilities Enabled and Enable Passthrough. Also, make sure Tracking Origin Type is set to floor.
Switch OVR Passthrough Layer to Underlay
On the XR Rig Advanced, under the Center Eye Anchor Camera change Clear Flags to Solid Color, and Background to Black, and make sure that the A is set to transparent. Make sure your Center Eye is set as Main Camera
Disable the OVR Camera Rig
Under the XR Rig Advanced, you’ll see that a new hierarchy has been added by the OVR Rig. If you delete it, OVR will add it back. You just have to disable it and leave it there.
Bring an object into your scene. Everyone does these tutorials with a box. Don’t be like everyone else.
Make sure your current scene is added to Build Settings.
On your Quest 2 make sure Passthrough is enabled. If you want a cooler experience, and you have developer options, then disable the Guardian and walk around your house.

My novel, Vir Kwai: From the Shadows at https://www.amazon.com/Vir-Kwai-Shado...
Check out my Squadmates
Hornet    / @blacksonic1991  
J4Slater    / @j4slater67  
*To Show Support**
Merch https://jamesclark14.live/merch


*Social Media**
  / jamesbyronclark  
  / longlivegeek