Game Development Reference
In-Depth Information
For depth textures and other floating-point data, you can use the histogram
feature to remap the float values into the 0.0-1.0 display space. If a certain part of
the dynamic range is more populated in the histogram, move the sliders to either
side of the range to remap it for easy display, allowing you to see details that might
have otherwise remained invisible.
21.2.5 Inspecting API State
The next area of inspection is seen on the left-hand side of the screen. Every point
along the GPU pipeline exposed via the Direct3D API has an entry in the graph.
You can click, for instance, on the Output Merger stage and look at blend state.
Maybe the scrubber (shown at the top of the window) is on a draw call that is
part of the opaque geometry (as annotated by the Direct3D performance markers),
but blending is enabled. This could cause issues with pixel throughput, hurting
performance.
Every bit of the Direct3D state can be easily inspected from these screens.
While scrubbing through your depth prepass or your shadow pass, make sure, for
instance, that color writes are disabled. Another problematic setting can be the
winding order for backface culling. Don't see geometry on the screen? Enter the
Graphics Inspector, make sure the pretransform geometry is correct, and look at
the winding order.
21.2.6 Using Pixel History
A common question asked when looking at the final output of the renderer is, “Why
is this pixel the color that it is?” In the past, you would have to use some dicult
debugging techniques to try and see all fragments that contributed to a given pixel,
like eliminating draw calls, limiting the geometry for a given draw call, maybe even
using printf! Parallel Nsight has a feature to show you exactly why a pixel wound
upacertaincolor:PixelHistory(see Figure21.6 ) .
The way to access this feature is to use the scrubber to the point in the frame,
or beyond, where you see the rendering issue. Then, go to the Draw Call Page, as
detailed above, and click on the render target that shows the pixel in question. In
the lower-right corner is a link called Pick Pixel. This will change the cursor to
red and allow you to select the pixel of interest. Once you do, you will see a list
of fragments that were blended to create the pixel. Select the one with the output
color that seems to be the problem and you can then select Debug Pixel, and the
debugger will put a sophisticated conditional breakpoint into the code to isolate
the fragment in question. This will allow you to step through the pixel shader
and inspect local variables, as well as calculation results, to determine what went
wrong.
Because the Pixel History feature utilizes many of the HLSL debugger features,
you will need to run this on a remote machine to ensure that the Visual Studio
GUI remains accessible.
Search WWH ::




Custom Search