LoginSignup
3
1

More than 5 years have passed since last update.

UnityのUTS_EdgeDetectionでアウトラインを表示する。

Posted at

VRには使えないがUnityでUTS2の新しいのが出てたので。
今回はポストエフェクトでアウトラインを表示するので、カメラごとに適用される。

環境

Unity2017.1.0f3

はじめに

DATA DOWNLOAD-利用規約 | UNITY-CHAN! OFFICIAL WEBSITEからUTS2.0.4をダウンロード。
プロジェクトにUTS2.0.4のファイル内にある、UTS_EdgeDetection.unitypackageをインポートしておく。

アウトラインの表示

適用したいカメラにAdd ComponentからUTS_EdgeDetectionを追加する。
2018-05-06 16_11_36-Unity 2017.1.0f3 Personal (64bit) - Untitled - UnityChanToonShaderVer2_Project-m.png

各Modeの説明

Sobel Depth

距離によるエッジ検出。
デフォルトだと距離によって濃さが異なる。
Edges Colorでアウトラインの色を変えられる。
Edge Exponentで距離による濃さを調整出来る。下げるときは面にも表示がかかるので注意。

Edge Exponent が 1 の場合
2018-05-06 17_27_26-.png
Edge Exponent が 0.1の場合
2018-05-06 17_29_11-.png

Sobel Depth Thin

Sobel Depthの細い(1px?)バージョン
2018-05-06 17_32_17-.png

Roberts Cross Depth Normals

Sobel Depthより太く強調される。
法線も使っているっぽいので角も検出されている。

値がデフォルトの場合
2018-05-06 17_39_17-.png

Sobel Color

色の違いによるエッジ検出。
Color Filter Powerで検出する範囲を変えられる。
公式には

Sobel Color Filterを使うことで、効果的にトゥーンラインエッジを強調し、セル画時代の色トレス風の雰囲気を出すことができます。

とあるので、キャラクターに向いてると思われる。

Color Filter Powerが 1 の場合
2018-05-06 17_42_52-.png

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