LoginSignup
0
0

More than 3 years have passed since last update.

CameraのDepthTextureModeをDepth有効にした際のFrameDebuggerの変化

Last updated at Posted at 2020-06-26

設定し直すのが面倒なので画像付きでメモしておきます。

環境はこちら

  • Unity2019.4.0f1
  • 新規シーン
  • Cameraの設定は下記
    • HDRなし
    • MSAAなし
    • ClearFlag は SolidColor
  • Lightingは下記
    • Shadowなし
  • この状態でキューブを置く

スクリーンショット 2020-06-27 2.01.11.png
で、この状態になるわけですが、
FrameDebugを確認すると
スクリーンショット 2020-06-27 2.01.22.png
こんな感じ。

  • ClearとCube描画でEvent2つ。
  • Statsを見ると
    • Batches は 1
    • SetPass は 1
  • RenderTargetは no name

で、ココでCameraのDepthTextureModeをDepthに設定

DepthCheck.cs
public class DepthCheck : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        var camera = GetComponent<Camera>();
        camera.depthTextureMode = DepthTextureMode.Depth;
    }
}

すると、FrameDebugは下記。
スクリーンショット 2020-06-27 2.02.07.png

  • Eventは4つ
    • まずDepthTextureを更新して、その後先程の描画を行う
  • Statsを見ると
    • Batches は 2
    • SetPass は 2
  • RenderTargetは
    • UpdateDepthBuffer は CameraDepthTexture
    • メイン描画部分は no name

UpdateDepthTextureが描画前に追加されます。


とりあえずのメモ書きということで置いておきます。
我ながらレベルの低い事をやっているけれども、それでもログを取っておけば今後の記事でリンクも貼れて手間が解消できるはず…。

0
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
0
0