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

[MR Dev Tips #11] Unity Profiler の表示フレーム数を変更する方法

Last updated at Posted at 2023-08-23

はじめに

今回は HoloLens 2 アプリケーションの開発を行う際に、デバッグで使用する Unity Profiler のプロパティに関するお話です。

Unity Profiler でキャプチャできるフレーム数はデフォルトで 300 になっています。ターゲットフレームレート (FPS) が 60 の HoloLens 2 では、約5秒間のキャプチャができるという計算です。ただ、実際に試してみると、5秒間でデバッグを行うのは少し難しいです。Unity Profiler のキャプチャを停止して、CPU や メモリ使用率等を確認する際、少しでも長くキャプチャできた方がデバッグがしやすいと思います。

本記事では、Unity Profiler の表示フレーム数 (Unity Profiler でキャプチャデータが保持されるフレーム数) の変更方法についてご紹介します。

(筆者訳) デフォルトの設定では、プロファイラーはゲームの最後の 300 フレーム の記録を保持し、すべてのフレームに関する情報を表示することができます。[Edit] > [Preferences] で記録されるフレーム数を 300 ~ 2000 フレームの間で変更することができます。このフレーム数を増やすと、プロファイラーのオーバーヘッドとメモリ使用率によってパフォーマンスが集中する可能性があります。

By default, the Profiler records and keeps the last 300 frames of your game, and shows you detailed information about every frame. You can increase the number of frames it records in the Preferences window (menu: Edit > Preferences), up to 2,000 frames. Note: If you increase this setting to a large number of frames, the Profiler’s overhead and memory usage might become more performance intensive.

検証環境

  • Unity 2020.3.48f1

手順

Unity Profiler は [Window] > [Analysis] > [Profiler] から開くことができます。

image.png

デフォルトの設定では、300フレームだけ記録されるようになっています。

image.png

記録されるフレーム数を変更するには、[Edit] > [Preferences] を開きます。
Preferences の [Analysis] > [Profiler] タブを選択して、[Frame Count] プロパティを変更します。

image.png

試しに 2000 に設定してみたところ、横軸のフレーム数が増えたので波の見え方が変わりました。FPS 60 が出ていると仮定すると、約33秒間のフレームデータをキャプチャすることができる計算になります。

image.png

以上で、Unity Profiler の表示フレーム数を変更することができました!

Refs

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?