Skip to content

Commit

Permalink
Added missing HDRP debug menu documentation (#2379)
Browse files Browse the repository at this point in the history
* Add missing debug menu documentation

* Update render graph link

* typos

* Update Render-Pipeline-Debug-Window.md

* Add case of zero normals creating nans

* Update doc
  • Loading branch information
adrien-de-tocqueville authored and sebastienlagarde committed Oct 29, 2020
1 parent 042d3ae commit 126a40f
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 38 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ If you are unable to fix the source of the NaN/Inf values, [HDRP Cameras](HDRP-C

To find the root cause of a NaN/Inf, HDRP includes a debug mode which displays pixels that contain NaNs/Infs in a recognizable color. To use this debug mode:

1. Open the Render Pipelines Debug window (menu: **Window > Render Pipeline > Render Pipeline Debug**).
1. Open the Render Pipeline Debug window (menu: **Window > Render Pipeline > Render Pipeline Debug**).
2. Go to **Rendering** and set **Fullscreen Debug Mode** to **NanTracker**.

This helps you to see if there are actually NaNs/Infs on screen and which material causes them. However, if you need more information, such as which particular draw call causes the issue, you can use frame debugging tools such as [RenderDoc](https://renderdoc.org/). For information on how to use RenderDoc to capture frames in Unity, see [RenderDoc integration](https://docs.unity3d.com/Manual/RenderDocIntegration.html).

A common situation that leads to NaNs is when a mesh is imported with ill-defined normals, like normals equal to the zero vector.
To find these normals, you can use one of the normal visualization modes in the [**Material** panel](Render-Pipeline-Debug-Window.html#material-panel) of the Render Pipeline Debug window.

#### RenderDoc

After you capture a frame, RenderDoc can display pixels with a NaN/Inf value as pure red, which helps you to find NaN/Inf values because it is much easier to see than the standard white/black pixels that HDRP renders for invalid values. To do this, in the Texture Viewer, open the **Overlay** drop-down and click the **NaN/Inf/-ve Display** option.
Expand All @@ -54,4 +57,4 @@ After you capture a frame, RenderDoc can display pixels with a NaN/Inf value as

Now that it is easier to see the NaN/Inf values, you can start to look for them. If they are still not obvious, you can look at the bloom dispatches to see where bloom propagates the NaN/Inf pixels from, then pinpoint the exact pixel/s responsible. Taking the example images in the [propagating NaNs/Infs section](#Propagating-NaNs/Infs), you can see by how bloom expands the NaN/Inf values that the source is around the center of the screen, on the sphere's Material.

After you find which Materials/shaders produce the NaNs/Infs, you can then debug them to find out which operation actually causes the invalid values.
After you find which Materials/shaders produce the NaNs/Infs, you can then debug them to find out which operation actually causes the invalid values.
Loading

0 comments on commit 126a40f

Please sign in to comment.