官术网_书友最值得收藏!

Choosing your target VR platforms and toolkits

While much of your development will focus on the artwork, behaviors of game objects, and interactive game mechanics of your application, from the very beginning of your project, you should also identifywhich platforms and devices you are targeting. In ordinary Unity projects, it's often sufficient to simply choose the Build Settings target platform (for example, Android or Windows) and then configure Player Settings for build runtime options. But for VR, there's more. You need to manage the VR plugins you will need and use additional toolkit(s) for developing the project. Generally, your Unity VR project will need to include the following:

  • Select a Target Platform for your builds (for example, Android versus Standalone/Windows).
  • Install an XR Plugin that drives the VR devices.
  • Within your scene, you will include a VR-enabled camera rig for tracking head and hand locations in 3D space.
  • Using other components provided with Unity's XR Interaction Toolkit for handling interaction with game objects and locomotion in your scenes.
  • Alternatively, you may choose to include device-specific toolkits, often provided by device manufacturers that have been tuned to their specific devices and often include a suite of prefabs, components, and shaders. These higher-level add-ons help you create interactive, responsive, and comfortable VR experiences tailored to a specific platform.

Unity has a growing library of built-in classes and installable packages to support VR (or rather, XR including augmented reality devices), including stereo rendering, input tracking, user interactions, and audio spatializers. Some features are limited by specific platform capabilities, but generally, they're designed to be device-independent.

I will walk you through the details of installing and configuring your project in this chapter. If you are not sure which platform, XR plugin, and device toolkit to include in your project, consult the following table, which shows many of the major consumer VR devices available today and the options for the development platform, target device platform, VR runtime, XR plugin, and optional device toolkit. The first table identifies the plugins provided and supported directly by Unity:

The following table shows plugins that have been announced but are not currently available (at the time this was written):

Note that Valve's OpenVR supports multiple VR devices, although OpenVR with Oculus or immersive Windows MR devices also require their corresponding runtime app be running in the background (Oculus Desktop or Mixed Reality Portal, respectively). Also note that, as of October 2019, Google discontinued Daydream and open-sourced the Cardboard SDK. As of December 2020, Oculus is sunsetting the Oculus Go and will stop accepting new applications in its store.

If you try to install multiple device toolkit packages in a Unity project, you may get irreconcilable errors caused by code conflicts. You can temporarily remove folders from Assets/ by renaming the offending folder with a trailing tilde ( ~) outside of Unity (for example, in Windows Explorer or macOS X Finder). For example, rename SteamVR to SteamVR~ and Unity will then ignore the folder and think it's been removed. However, note that your revision control tool (for example, Git) will still have the files.

So, let's get started by enabling VR in the project's scene.

主站蜘蛛池模板: 西峡县| 东明县| 英德市| 津南区| 静乐县| 东城区| 景泰县| 黄陵县| 衡山县| 襄樊市| 将乐县| 望奎县| 高碑店市| 酒泉市| 林州市| 陆良县| 肇东市| 定兴县| 措勤县| 郎溪县| 遵义县| 东海县| 确山县| 和静县| 乳山市| 恭城| 惠安县| 龙州县| 温泉县| 科技| 民丰县| 灵丘县| 清徐县| 富裕县| 汝州市| 清丰县| 肇庆市| 南部县| 吴忠市| 花莲市| 阳高县|