< Return to Video

Frame Debugger - Unity Official Tutorials

  • 0:01 - 0:04
    In Unity rendering a frame to the screen
  • 0:04 - 0:07
    occurs in a linear sequence of events.
  • 0:09 - 0:11
    The Frame Debugger is a tool which lets
  • 0:11 - 0:14
    you see all the steps involved
  • 0:14 - 0:17
    in rendering a frame step by step.
  • 0:17 - 0:20
    It allows you to the see intermediate render targets,
  • 0:20 - 0:23
    shadow maps and each draw call
  • 0:23 - 0:26
    that contributes to the frame, in order.
  • 0:27 - 0:29
    The frame debugger is accessed from
  • 0:29 - 0:31
    Window - Frame Debugger.
  • 0:41 - 0:45
    The editor will pause and in the frame debug window
  • 0:45 - 0:48
    a sequential list of each step involved
  • 0:48 - 0:51
    in current frame will displayed.
  • 0:52 - 0:54
    Many of these are draw called.
  • 0:54 - 0:57
    But they also involve other render related events
  • 0:57 - 0:59
    like frame buffer clears,
  • 0:59 - 1:01
    which set the initial colours of the screen,
  • 1:01 - 1:04
    or compute shader invocation.
  • 1:05 - 1:08
    A draw call is a command in which the CPU
  • 1:08 - 1:11
    sends content to be rendered, like meshes,
  • 1:11 - 1:15
    to the GPU to be rendered as pixels for display.
  • 1:16 - 1:18
    At the top of the window are two
  • 1:18 - 1:20
    forward and back buttons
  • 1:21 - 1:25
    along with a slider, which will allow you to step through this list in order.
  • 1:49 - 1:53
    Selecting a single step in the process from the main list
  • 1:53 - 1:56
    will cause that draw call or event,
  • 1:56 - 1:58
    along with the steps prior to it,
  • 1:58 - 2:00
    to be drawn in the game view.
  • 2:01 - 2:04
    If that step is drawing a mesh renderer
  • 2:04 - 2:06
    the game object with that mesh renderer attached
  • 2:06 - 2:08
    will be highlighted in the hierarchy.
  • 2:12 - 2:14
    Viewing a step in the main list allows
  • 2:14 - 2:16
    you to see where in the overall
  • 2:16 - 2:18
    process of drawing the frame it occurs.
  • 2:18 - 2:20
    Related steps are grouped together
  • 2:20 - 2:23
    and their views can be expanded or collapsed.
  • 2:24 - 2:26
    Analysing frames in this way is useful
  • 2:26 - 2:30
    to learn precisely how and in what order
  • 2:30 - 2:32
    Unity is rendering your frame.
  • 2:37 - 2:39
    When setting up a new project we
  • 2:39 - 2:42
    can choose between 4 different render paths.
  • 2:43 - 2:45
    Each render path renders content differently.
  • 2:46 - 2:48
    Choosing which to use is highly
  • 2:48 - 2:50
    dependent on the nature of your project.
  • 2:52 - 2:54
    To choose a render path for your project
  • 2:54 - 3:00
    navigate to Edit - Project Settings - Player
  • 3:04 - 3:08
    and select a rendering path from the drop-down
  • 3:08 - 3:10
    under Other Settings.
  • 3:15 - 3:17
    For more information about the available
  • 3:17 - 3:20
    render paths please see the information linked below.
  • 3:21 - 3:23
    Each render path can use a different
  • 3:23 - 3:26
    number of render targets.
  • 3:26 - 3:28
    A render target is a feature of
  • 3:28 - 3:30
    GPUs that allow a scene
  • 3:30 - 3:33
    to be rendered to an intermediate memory buffer.
  • 3:34 - 3:36
    Using the for Forward rendering path
  • 3:36 - 3:39
    1 render target is used by default.
  • 3:40 - 3:43
    Here shown as RT0,
  • 3:43 - 3:45
    along with a depth buffer.
  • 3:47 - 3:49
    Using customer shaders it's possible
  • 3:49 - 3:52
    to use more render targets in forward rendering
  • 3:52 - 3:54
    but using the standard shader this is
  • 3:54 - 3:56
    the default behaviour.
  • 3:58 - 4:02
    This project is in differed rendering mode.
  • 4:02 - 4:06
    In differed rendering mode multiple render targets are used.
  • 4:06 - 4:09
    When rendering to multiple targets at once
  • 4:09 - 4:12
    you can select which display using the drop down menu.
  • 4:14 - 4:16
    In this example we can see the diffuse,
  • 4:18 - 4:20
    specular,
  • 4:22 - 4:24
    normals,
  • 4:26 - 4:29
    and emission and indirect lighting buffers
  • 4:29 - 4:32
    in in Unity 5 differed shading mode
  • 4:32 - 4:34
    using the standard shader.
  • 4:35 - 4:37
    You can also see the depth buffer by
  • 4:37 - 4:39
    selecting it from the same drop down.
  • 4:44 - 4:46
    When an event is highlighted
  • 4:46 - 4:48
    information will be displayed about that event
  • 4:48 - 4:50
    in the information panel.
  • 4:52 - 4:54
    In the case of draw calls the information
  • 4:54 - 4:56
    panel also includes buttons which will
  • 4:56 - 4:59
    allow you to isolate and visualise information,
  • 4:59 - 5:01
    including the red,
  • 5:03 - 5:04
    green,
  • 5:05 - 5:08
    blue and alpha channels
  • 5:08 - 5:10
    of the selected render target.
  • 5:11 - 5:13
    You can also adjust the brightness of the
  • 5:13 - 5:17
    display using the levels bracketed slider here.
  • 5:19 - 5:22
    This can be useful in HDR rendering
  • 5:22 - 5:24
    to isolate certain luminance ranges
  • 5:24 - 5:27
    of a frame for analysis.
Title:
Frame Debugger - Unity Official Tutorials
Description:

more » « less
Video Language:
English
Duration:
05:33

English subtitles

Revisions