简体   繁体   中英

Unity AR camera to render like VR - Mixed reality

I am currently playing around with Unity. I have a simple question that I can not find and answer for.

I can easily set up an AR session in Unity for iOS and Android using the AR foundation toolkit. But I would like to make the phone camera picture to render in steroscopic like in regular VR thus creating a Mixed Reality project.

I don't want to use the SDK related to Microsoft Hololens since I would like to aim the development for iOS and Android devices.

Thanks in advance!

Premade solution

Microsoft has a package that aims for mixed reality but it's for Android and iOS: https://github.com/Microsoft/MixedRealityToolkit-Unity - but this package is huge, and if you have a project already it will be hard to convert to use this package.

Custom solution

If you want to create something together for the prototype (although I would not recommend this for production code as it's not optimized) you can use 2 cameras and set them as following

相机设置

Create 2 cameras, with slightly offset origin. And use the ViewportRect parameter of the camera to set rendering for two different eyes.

One camera should have (x: 0, y:0, w: 0.5, h: 1) second (x: 0.5, y:0, w: 0.5, h: 1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM