Version: 2020.2
2D 물리 프로파일러 모듈
UI 및 UI 세부 정보 프로파일러

Rendering Profiler module

The Rendering Profiler displays rendering statistics and information about what the CPU and GPU do to render the Scene. You can use these statistics to measure the resource intensity of different areas of the Scene, which is useful for optimization.

The chart displays the number of Batches, SetPass Calls, Triangles and Vertices your application rendered. The lower pane displays more rendering statistics, which match the ones shown in the GameView Rendering Statistics window.

The Rendering Profiler module
The Rendering Profiler module

The Rendering Profiler module’s chart is divided into four categories as follows:

차트 설명
Batches Count The number of batches Unity processed during a frame.
SetPass Calls Count The number of times Unity switched which shader pass it used to render GameObjects during a frame. A shader might contain several shader passes and each pass renders GameObjects in the scene differently.
Triangles Count The number of triangles Unity processed during a frame.
Vertices Count The number of vertices Unity processed during a frame.

모듈 세부 정보 창

When you click on the Rendering Profiler module, the details pane in the lower half of the window displays detailed rendering statistics. These statistics are similar to the statistics shown in the Rendering Statistics window.

In the top left of the details pane, select Open Frame Debugger to open the Frame Debugger, which gives you information on individual drawcalls that rendered the frame.

These statistics are also available via the ProfilerRecorder API and in the Profiler Module Editor so you can add them to a custom Profiler module.

Statistic 설명 Accessible in Release Players
SetPass Calls Count The number of times Unity switched which shader pass it used to render GameObjects during a frame. A shader might contain several shader passes and each pass renders GameObjects in the scene differently. 지원
Draw Calls Count The total number of draw calls Unity issued during a frame. Unity issues draw calls when it renders GameObjects to the screen. This number includes non batched draw calls as well as dynamic and static batched draw calls. 지원
Total Batches Count The total number of batches Unity processed during a frame. This number includes both static and dynamic batches. 지원
Triangles Count The number of triangles Unity processed during a frame. 지원
Vertices Count The number of vertices Unity processed during the frame. 지원
(Dynamic Batching) This section contains statistics on dynamic batching. 미지원
Dynamic Batched Draw Calls Count The number of draw calls Unity combined into dynamic batches. 미지원
Dynamic Batches Count The number of dynamic batches Unity processed during the frame. 미지원
Dynamic Batched Triangles Count The number of triangles in the GameObjects included in the dynamic batches. 미지원
Dynamic Batched Vertices Count The number of vertices in the GameObjects included in the dynamic batches. 미지원
Dynamic Batching Time The time Unity spent creating dynamic batching structures. 미지원
(Static Batching) This section contains statistics on static batching. 미지원
Static Batched Draw Calls Count The number of draw calls Unity combined into static batches. 미지원
Static Batches Count The number of static batches Unity processed during a frame. 미지원
Static Batched Triangles Count The number of triangles in the GameObjects included in the static batches. 미지원
Static Batched Vertices Count The number of vertices in the GameObjects included in the static batches. 미지원
(Instancing) This section contains statistics on GPU instancing. 미지원
Instanced Batched Draw Calls Count The number of draw calls Unity combined into instance batches. 미지원
Instanced Batches Count The number of batches Unity processed to render instanced GameObjects during a frame. 미지원
Instanced Batched Triangles Count The number of triangles in the instanced GameObjects. 미지원
Instanced Batched Vertices Count The number of vertices in the instanced GameObjects. 미지원
Used Textures Count

Used Textures Bytes
The number of textures Unity used during the frame and the amount of memory the textures used. 미지원
Render Textures Count

Render Textures Bytes
The number of RenderTextures Unity used during the frame and the amount of memory the RenderTextures used. 지원
Render Textures Changes Count The number of times Unity set one or multiple RenderTextures as render targets during the frame. 지원
Used Buffers Count

Used Buffers Bytes
The total number of GPU buffers and memory they used. This includes vertex, index and compute buffers and all internal buffers required for rendering. 지원
Vertex Buffer Upload In Frame Count

Vertex Buffer Upload In Frame Bytes
The amount of geometry that the CPU uploaded to the GPU in the frame. This represents the vertex/normal/texcoord data. There might already be some geometry on the GPU. This statistic only includes geometry that Unity transfers in a frame. 지원
Index Buffer Upload In Frame Count

Index Buffer Upload In Frame Bytes
The amount of geometry that the CPU uploaded to the GPU in the frame. This represents the triangle indices data. There might already be some geometry on the GPU. This statistic only includes geometry that Unity transfers in a frame. 지원
Shadow Casters Count The number of GameObjects that cast shadows in a frame. If a GameObject casts multiple shadows (because multiple lights light it), it has one entry per shadow it casts. 지원

Availability in Players

The Rendering module Profiler counters are also available in Players. Use the ProfilerRecorder API to access Render Profiler module information in Players. High level counters are also available in Release Player.

The following example contains a simple script that collects “SetPass Calls Count”, “Draw Calls Count” and “Vertices Count” metrics and displays those as TextArea.

using System.Text;
using Unity.Profiling;
using UnityEngine;
 
public class RenderStatsScript : MonoBehaviour
{
    string statsText;
    ProfilerRecorder setPassCallsRecorder;
    ProfilerRecorder drawCallsRecorder;
    ProfilerRecorder verticesRecorder;

    void OnEnable()
    {
        setPassCallsRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Render, "SetPass Calls Count");
        drawCallsRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Draw Calls Count");
        verticesRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Vertices Count");
    }
 
    void OnDisable()
    {
        setPassCallsRecorder.Dispose();
        drawCallsRecorder.Dispose();
        verticesRecorder.Dispose();
    }

    void Update()
    {
        var sb = new StringBuilder(500);
        if (setPassCallsRecorder.Valid)
            sb.AppendLine($"SetPass Calls: {setPassCallsRecorder.LastValue}");
        if (drawCallsRecorder.Valid)
            sb.AppendLine($"Draw Calls: {drawCallsRecorder.LastValue}");
        if (verticesRecorder.Valid)
            sb.AppendLine($"Vertices: {verticesRecorder.LastValue}");
        statsText = sb.ToString();
    }
 
    void OnGUI()
    {
        GUI.TextArea(new Rect(10, 30, 250, 50), statsText);
    }
}

The Rendering Profiler module information belongs to the ProfilerCategory.Render Profiler category.

If you want to highlight the selected Rendering counters in a custom module, use the Module Editor to configure the chart and detailed view.

2D 물리 프로파일러 모듈
UI 및 UI 세부 정보 프로파일러