0Rae / CapstoneViewer1.7

1 stars 0 forks source link

기술분석.3 Unity-VirtualRealty 개요 #6

Open 0Rae opened 7 years ago

0Rae commented 7 years ago

Unity VR lets you target virtual reality devices directly from Unity, without any external plug-ins in projects. It provides a base API and feature set with compatibility for multiple devices. It has been designed to provide forward compatibility for future devices and software. The VR API surface is minimal by design, but will expand as VR continues to grow.

By using the native VR support in Unity, you gain:

Stable versions of each VR device A single API interface to interact with different VR devices A clean project folder with no external plugin for each device The ability to include and switch between multiple devices in your applications Increased performance (Lower-level Unity engine optimizations are possible for native devices)

Enabling Unity VR support

To enable native VR support for your game builds and the Editor, open the Player Settings (menu: Edit > Project Settings > Player). Select Other Settings and check the Virtual Reality Supported checkbox. Set this for each build target. Enabling virtual reality support in a standalone build does not also enable the support for Android (and vice-versa).

Use the Virtual Reality SDKs list displayed below the checkbox to add and remove VR devices for each build target. The order of the list is the order that Unity tries to enable VR devices at runtime. The first device that initializes properly is the one enabled. This list order is the same in the built player.

VR은 관례적으로 Unity의 외부 플러그인에서 지원되어 왔습니다. 이 방식에는 약간 단점이 있습니다

어떤 VR 장치도 각각 고유의 플러그인이 필요합니다. 그러한 플러그인이 충돌을 일으킬 수 있습니다. 여러 장치를 지원하고, VR 장치용 플러그인의 활성화/비활성화를 전환하려면 불필요한 수고가 듭니다. VR의 최신 SDK가 릴리스 될 때마다 오래된 게임이 작동하지 않을 가능성이 있었습니다. VR과 비 VR 모드의 전환은 쉬운 일이 아닙니다. 플러그인에서 카메라를 두 개로 나누는 방식으로는, 로우 레벨의 엔진 최적화를 할 수 없습니다.

Unity VR은 외부 플러그인을 필요로 하지 않고, Unity에서 VR 장치로 직접 전송하는 것을 가능하게 합니다. 장치 및 소프트웨어의 전방 호환성을 목표로 기반이 되는 API와 기능 세트를 제공하고 있습니다.

0Rae commented 7 years ago

What happens when VR is enabled

When VR is enabled in Unity, a few things happen automatically:

Automatic rendering to a head-mounted display

All Cameras in your Scene are able to render directly to the head-mounted display (HMD). View and Projection matrices are automatically adjusted to account for head tracking, positional tracking and field of view.

It is possible to disable rendering to the HMD using the Camera component’s stereoTargetEye property. Alternatively, you can set the Camera to render to a Render Texture using the Target Texture property.

Use the stereoTargetEye property to set the Camera to only render a specific eye to the HMD. This is useful for special effects such as a sniper scope or stereoscopic videos. To achieve this, add two Cameras to the Scene: one targeting the left eye, the other targeting the right eye. Set layer masks to configure what is sent to each eye. Automatic head-tracked input

Head tracking and the appropriate field of view (FOV) is automatically applied to the Camera if your device is head-mounted. You can manually set the FOV to a specific value, but you cannot set the Camera’s transform values directly. See the section below on Understanding the Camera to learn more.

Head tracking and positional tracking are automatically applied, so that the position and orientation most closely matches the user’s position and orientation before the frame is rendered. This gives a good VR experience, and prevents the user from experiencing nausea.

Understanding the camera

The Camera Transform is overridden with the head-tracked pose. To move or rotate the Camera, attach it as a child of another GameObject. This makes it so that all Transform changes to the parent of the Camera affect the Camera itself. This also applies to moving or rotating the camera using a script.

Think of the Camera’s position and orientation as where the user is looking in their neutral position.

There are differences between seated and room-scale VR experiences:

If your device supports a room-scale experience, the Camera’s starting position is the center of the user’s play space. Using the seated experience, you can reset Cameras to the neutral position using VR.InputTracking.Recenter(). Each Camera that is rendering to the device automatically overrides the field of view of the Camera with the field of view your user inputs in the software settings for each VR SDK. You can override this field of view value through script at runtime to set a custom field of view specific to your application.

To set a custom field of view, use Camera.fieldOfView

Unity에서 VR을 사용하면 자동적으로 다소 변화가 일어납니다:

자동적인 입체 표시

입체 이미지는 절대로 카메라가 두 개 필요하다는 뜻은 아닙니다. 렌더 텍스처가 없는 카메라는 자동으로 장치용으로 입체 렌더링합니다. 뷰와 프로젝션 매트릭스는 시야와 헤드 트래킹을 고려하여 조정됩니다. 양쪽 눈 모두 계산량을 줄이기 위해 최적화가 자동으로 발생합니다.

헤드 추적의 자동화

헤드 추적과 적절한 시야가 자동으로 카메라에 적용됩니다 (카메라 헤드 마운트 형인 경우). 더 좋은 VR 체험에는, 지연이 더 적은 헤드 추적이 필수이므로, 이것은 기본적으로 이루어집니다.

0Rae commented 7 years ago

Hardware and software recommendations for VR development in Unity

Hardware

Achieving a frame rate similar to your target HMD is essential for a good VR experience. This must match the refresh rate of the display used in the HMD. If the frame rate drops below the HMD’s refresh rate, it is particularly noticeable and often leads to nausea for the player.

Refresh rates for VR devices:

VR Device Refresh Rate Gear VR 60hz Oculus CV1 90hz Vive 90hz Software

Windows: Windows 7, 8, 8.1, and Windows 10 are all compatible. Android: Android OS Lollipop 5.1 or higher. OS X: OSX 10.9+ with the Oculus 0.5.0.1 runtime. However, Oculus have paused development for OS X, so use Windows for native VR functionality in Unity. Graphics card drivers: Make sure your drivers are up to date. Every device is keeping up with the newest drivers, so older drivers may not be supported.

Device runtime requirements

Each VR device requires that you have appropriate runtime installed on your machine. For example, to develop and run Oculus within Unity, you need to have the Oculus runtime (also known as Oculus Home) installed on your machine. For Vive, you need to have Steam and SteamVR installed.

Depending on what version of Unity you are using, the runtime versions for each specific device that is supported by Unity may differ. You can find runtime versions in the release notes of each major and minor Unity release.

With some version updates, previous runtime versions are no longer supported. This means that native Unity VR support does not work with earlier runtime versions, but continues to work with new runtime versions.

Unity native VR support does not read plug-ins from within your project’s folder, so including earlier versions of the plug-in with native support will fail if you have VR support enabled. If you wish to use an earlier version with a release of Unity that no longer supports that version, disable Native VR Support (go to Other Settings and uncheck Virtual Reality Supported). You can then access the plug-in like any other 3rd party plugin. See the section above on Enabling Unity VR Support for more details.

0Rae commented 7 years ago

1

0Rae commented 7 years ago

2