2
0

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 1 year has passed since last update.

部分的にPostProcessをかける方法ノート

Last updated at Posted at 2022-11-22

※自分向けノートですが、View多ければ記事整えたいと思います。

やりたいこと

  • 一般的なPostProcessは画面内オブジェクトすべてにかかってしまう
  • しかし、PostProcessをかけないで置きたいオブジェクトがある
  • PostProcessがかかる範囲を部分的にしたくなった

参考URL

開発環境

  • Unity
    • PostProcessをインストールしておく

レイヤーをつくっておく

ここでは仮に下記とする

  • PP
  • Avatar

Skybox用のRenderTextureを作成しておく

  • Project -> 右クリック -> Create -> RenderTexture
  • 名前をここでは ScreenRenderTexture とする

Canvas(RawImage)を作成しておく

  • Hierarchyで右クリック -> UI -> RawImage
  • Canvas
    • Width : 1920
    • Height : 1080
    • Canvas
      • Render Mode : Screen Space - Camera
      • Render Camera : Camera1
  • RawImage
    • Width : 1920
    • Height : 1080
    • RawImage
      • Texture : ScreenRenderTexture

カメラ設定

  • Camera1 (postprocessオンで使う)

    • Layer : PP
    • Clear Flags : Dont Clear
    • Culling Mask : UI, PP
    • Depth : 1
    • Post-process Layer (追加する)
      • Layer : PP
  • Camera2 (post-processオフで使う)

    • Layer : Default
    • Clear Flags : Dont Clear
    • Culling Mask : Avatar
    • Depth : 0
  • Camera3 (Skybox映す)

    • Layer : PP
    • Clear Flags : Skybox
    • Culling Mask : Nothing
    • Depth : -1
    • Target Texture : ScreenRenderTexture
    • Post-process Layer (追加する)
      • Layer : PP

オブジェクトの設定

  • Cube
    • Layer : Avatar
  • Cube(1)
    • Layer : PP
    • Post-process Volume (追加する)

理由はわからないがポイント

  • Cube(1)はPost-process Volumeが付いている
  • Cube(1)をCanvasへ丁度いい距離に置く必要がある
    • post-process Volumeのコライダーでpost-process範囲を決めてるっぽいがよくわからない
2
0
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?