5
3

More than 3 years have passed since last update.

Unity 2019.3 Built-inとHDRPとURPのPost Processingの選択肢について整理する

Last updated at Posted at 2020-03-04

環境

  • Unity 2019.3.3

構成の選択肢

Unity 2019.3.3において、純正のPost Processingを用いる場合、以下の構成から選択することになるという認識です。Unityをウォッチし続けらていなく、確信が持てないので、間違っていたらごめんなさい:bow:

  • HDRP + Integrated Post Processing (付属している)
  • URP + Integrated Post Processing (付属している)
  • Built-in Renderer + Post Processing V2 (Package Managerでインストールする)
  • URP + Post Processing V2 (Package Managerでインストールする)(2020.1ではサポートされない) 2020/3/5 追記

URP + Integrated Post Processing の特徴

先にあげた構成において、それぞれ、違いがあるという認識です。今回は、URP + Integrated Post Processing の特徴について簡単に調査しました。

  • HDRPの説明に「Compute Shader compatible」と書いてあるので、対となるURPはCompute Shaderがなくても動くRPという方針と汲み取ることができそうです。
  • Compute Shaderが使えない環境でも動作することを想定しているURPのIntegrated Post Processingにおいて、Compute Shader を用いた Post Processingが付属機能として実装される可能性は、低いと考えています。
  • 現状、Auto Exposureは、Compute Shaderで実装されているようなので、URP Integrated Post Processingには、Auto Exposure機能がなさそうです。
  • 公式サイトより、Compute Shaderをサポートするハードウェアなら、UniversalRPで、これら(Compute Shaderを使う)のエフェクトが使えます、という旨が読み取れるのですが、文章の意図を把握できていません。Integrated Post Processingのことを指していない可能性があります。(2020/3/5 追記)URP 7.0の資料を読んでいました。
  • (2020/3/5 追記)URP 7.2の資料には、Post Processing V2を2019.4 LTS.でサポートするが、 2020.1ではintegratedのみをサポートすると読み取れます。

URP 7.0 公式資料より引用

Effects that UniversalRP does not support
Compute-based effects by default, including Auto-exposure, Ambient Occlusion (MSVO) and Debug Monitors. You can use these effects in UniversalRP, but only if your target hardware supports Compute Shaders. If your target hardware does not support compute shaders, Unity disables the post-processing effect at run time.

URP 7.2 公式資料より引用

The Universal Render Pipeline (URP) contains its own integrated post-processing solution. This version of URP also supports the Post Processing Version 2 (PPV2) package, for backwards compatibility with existing Projects.
Both post-processing solutions will be supported in the versions of URP that are compatible with Unity 2019.4 LTS. From Unity 2020.1, only the integrated solution will be supported.

HDRP 4.6 公式資料より引用

The High Definition Render Pipeline (HDRP) is a high-fidelity Scriptable Render Pipeline built by Unity to target modern (Compute Shader compatible) platforms.

Auto Exposureを使いたい場合の選択肢

  • Auto Exposureを独自に実装する
  • License上、問題ないことを確認して、Post Processing V2 の Auto Exposure機能を抜き出す
  • URP + Post Processing V2 という組み合わせで使う(非推奨)

[非推奨] URP + Post Processing V2 という組み合わせで使う方法

注意点

  • LWRP + Post Processing V2の構成が使えていた記憶があります。URP 7.0の資料を読むと、URPも7.0までは、使えていたのでしょうか。その互換用途に用意されていると思われます。
  • LWRP + Post Processing V2の既存プロジェクトがあり、URPに置き換えたい場合、バージョンを固定することを覚悟して、この組み合わせを使うことができそうですが、推奨されないと思います。

使用方法

Package Manager

  • Post Processing 2.3.0をインストールします。インストールしないと、Feature Set項目が表示されないと思います。
  • URPを 7.2.1 にUpdateします。7.2.1は、Verifiedがついていません。
  • 私が確認した限りでは、URP 7.1.8では、[Feature Set]項目(後述)が表示されないようです。記憶違いでなければ。 2020/3/5 改めて確認したところ、7.2.0にすると、Feature Setが表示されました。

1e.jpg

Scriptable Render Pipeline Asset

  • [Scriptable Render Pipeline Setting]Assetの[Inspector]に [Post-processing] - [Feature Set]-[Post Processing V2]項目が表示されます。

2.jpg

互換用途に用意しているのであって、近い将来サポートしない方針の警告が表示される

3.jpg

Post Processing V2 の設定

  • Post Processing V2の設定します。多くの記事が存在するため、詳細は省略させていただきます。

4e.jpg

Cameraの設定

  • CameraコンポーネントのPost Processing にチェックを入れることを忘れないようにします。(私は、このチェックに気づかず、時間を使ってしまいました。)

5.jpg

感想

  • URPで、Auto Exposureを使い場合、どうするのが最適解かを模索中です。
  • Fragment Shaderで平均輝度を計算するシェーダーを作ることを試してみたいのですが、知識、技術、時間不足です。
  • Scriptable Render Pipeline、Compute Shaderの使い方の勉強になりそうなので、良い課題になりそうと思っています。
5
3
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
5
3