LoginSignup
10
10

More than 3 years have passed since last update.

UnityのURP(Universal Render Pipeline)を使ってOculus Questに対応してみる

Posted at

はじめに

※Unity初心者です。
Oculus Questで快適にキレイな海を表示したくて、URPにたどり着きました。
試したときのメモです。

Universal Render Pipelineについて

シングルパス対応しているので、いろんなプラットフォームに向いている。(現在すべてのVRにも!)
UniversalRP-VRっていうVR専用のテンプレートがある。(見つかりませんでした)

新規プロジェクト作成

image.png

image.png

設定

いつものなので詳細省きます

image.png

PlayerSettings...
CompanyName修正、Valkan消す、MinimumAPIを6.0以上
XRSettings VirtualRealitySupported + Oculus, Single Pass

Switch Platform

Oculus Integrationインポート

VR,Platformだけチェック付けてインポート

materialがピンクになっているので選択して
image.png

Edit > Render Pipeline > Universal Render Pipeline > Upgrade Selected Materials to UniversalRP Materials
でURP用のマテリアルに変換する

image.png

Post-processing

今までのPost-processingは重く、OculusQuestに対応するには難しかったのですが、
URPは後処理になることで高速に処理できるようなので使ってみます。

Camera設定

OVRCameraRig 配置
Rendering > Post Processing にチェックを入れ、
Anti-aliasing をFXAAにする

image.png

Global Volume追加

HierarchyでVolume > Global Volumeを追加

image.png

追加したGlobal VolumeのVolumeでProfileを新しく作るのでNewボタンをクリック

image.png

Add OverrideでPost-processingを追加していく

image.png

モバイルで使いやすいのは下記エフェクト

  • Bloom
  • Color Grading
  • Vignette

早い動きだと酔いやすくなるのでVRでは効果を小さくした方がいいもの

  • Chromatic Aberration
  • Lens Distortion
  • Motion Blur

Bloom

明るい光を表現する

image.png

Threshold しきい値
Intensity 強度
Scatter 散布
Tint 色合い
Clamp 計算に使用する最大強度
High Quality Filtering パフォーマンスに影響を与えるのでVRでは使わない

Color Adjustments

色を調整する

image.png

Post Exposure 露出後
Contrast コントラスト
Color Filter カラーフィルター
Hue Shift 色相シフト
Saturation 飽和(すべての色の強度)

Vignette

端を暗くする

image.png

Color 色
Center 中心(0.5、0.5)
Intensity 強度
Smoothness 滑らかさ
Rounded 丸み

ビルド

調整難しい

image.png

おまけ

Oculus Questは無理ですが、Unityで試せるURPを使ったBoatAttackをインストールしてみます。

  1. GitLFSインストール
  2. リポジトリクローン(時間かかる)
  3. UnityHubでリストに追加して起動

めっちゃキレイ!レースができて、気持ちいいスピードが楽しい!
image.png

10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10