1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ユニティちゃんをDeferred Renderingに対応するメモ(更新中)

Last updated at Posted at 2017-12-31

Unity 2017のStandard AssetのPost-Processing Profileを色々使いたい。
でもDeferred Renderingすると、ユニティちゃんの描画が色々おかしい!

そこで調整方法をメモ。

無題.png

まずは2017の機能を堪能する為にAsset Storeへ

ユニティちゃん
無題.png

おなじみStandard Asset。
無題.png

しかし、楽しいImageEffectは「探さないで下さい」と書置きを残して去っているので連れ戻しに行く。

無題.png

Readme.txt
The old image effects have been deprecated and moved to the Asset Store: https://www.assetstore.unity3d.com/#!/content/83913

We recommend that you now use the new post-processing stack. You'll find it at https://www.unity3d.com/postprocessing

リダイレクトされて下記へ飛ぶ。ZIPで貰いましょう。
https://github.com/Unity-Technologies/PostProcessing

カメラの設定

そしてインポート(手動)。

ImageEffect用のプロファイルを下記で作成
無題.png

カメラに突っ込む
無題.png

(もしかして最新版変わっている?)

ImageEffectの設定

Deferred Renderingをしたいと思うのは、ライトをたくさん使いたい時などですが、ユニティちゃんはシェーダーの関係で夜のシーンに向かないです。私は下記の「Screen Space Reflection」を試したくてDeferred Renderingしました。

無題.png

image.png

↓↓↓

image.png

おや、なんかもうすでにユニティちゃんの描画おかしくないですか。

あぁ。なんかサングラス的なものが。
無題.png

ユニティちゃんを修正してしまう。

色々おかしいのですが、まずこのサングラス的なものの正体はcheekです。
ほっぺを薄ピンクにしているシェーダーがレンダリング順が変わって誤作動してます。

無題.png
レンダリング順をTransparentまで遅らせます。

ほっぺはOK。ほっぺは。
無題.png

今度はAnbient Occlusionが悪さしてます。
こっちはデフォルトだとこうなります。

無題.png

なので「Force Forward Compatibility」にチェック入れちゃいます。

これで対応できたかと思いきや。

無題.png

お分かりいただけただろうか。
「Screen Space Reflection」は一度レンダリングした結果を再利用しています。
ともすれば、ユニティちゃんシェーダの書き込み順が悪さしているのは明らかです。

(続く)

1
4
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
1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?