[Unity]GVR Unity v1.7でステレオレンダリングプレビューを行う方法

1. 対象のUnityおよびSDKバージョン

  • Unity 2017.1[1]
  • GVR Unity v1.7[2]

2. 方法

GVR Unity v1.7ではUnity Editorのプレーヤー上でステレオレンダリングが行えない[3].代替機能としてInstant Preview[4]による実機上での簡易なプレビュー機能を提供している.
Instant Previewの始め方は以下のとおりである.

  1. Instant Previewアプリ(apk)をAndroid端末にインストールする.
  2. ビルドプラットフォームがAndroidに設定されているか確認する.
  3. Instant Previewの.unitypackageをプロジェクトにImportする.
  4. InstantPreview/Assetsフォルダから[GvrInstantPreviewMain]プレファブのインスタンスをシーンヒエラルキーに追加する.このインスタンスはシーンを跨げないので最初のシーンのルートに追加する.
  5. Instant Previewの設定を必要に応じて行う.
    • Output Resolution: 出力解像度
    • Multisample Count: シーンに追加するマルチサンプルアンチエイリアス
    • Bit Rate: エンコードのビットレート.値を低くすると品質が低下する代わりにフレームレートが向上する.
  6. Android端末をUSBで接続しInstant Previewを起動する.
  7. 起動すると[Full VR preview]と[Controller only]のストリーミングモードが選択可能になる.Unity Editor上で[PLAY]を押すとストリームが始まる.

3. トラブルシューティング

Instant PreviewとUnityが接続できない場合

  • ビルドプラットフォームをAndroidに設定する.
  • プロジェクトには[gvr-unity-sdk]と[InstantPreview]の両方をインポートする.
  • [GvrInstantPreviewMain]プレファブをシーンに追加する.
  • Unityで[Play]を押したとき,コンソール画面に“GVR Unity SDK Version: 1.xx”と“Instant Preview Version: 1.0.0.x”の両方が表示されているか確認する(xはバージョンナンバーに置き換えられる).

[1] Unity – Download (https://store.unity.com/download)
[2] googlevr/gvr-unity-sdk・GitHub (https://github.com/googlevr/gvr-unity-sdk/releases)
[3] Google VR SDK for Unity | Google VR | Google Developers (https://developers.google.com/vr/unity/guide)
[4] Instant Preview | Google VR | Google Developers (https://developers.google.com/vr/tools/instant-preview)

sukanpin has written 22 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>