With the Graphics Frame Analyzer, you can discover which API calls affect specific pixels and minimize overdraw by removing redundant or unimportant calls. For example, lighting effects are typically produced by multiple rendering passes. You can determine whether you can reduce the number of iterations to produce a similar visual effect with higher performance.
To detect the sequence of API calls that affects the final color of the pixel:
- Open the captured frame, or select the color buffer of the render target from the Resource viewer.
Graphics Frame Analyzer opens the render target image in the Profiling view.
- From the drop-down menu, select Overdraw mode to visualize the hit count for each pixel of the render target image.
The brighter the color, the more times the pixel was updated. Hover over the pixel to see the hit count below.
- Click the pixel you want to analyze. Graphics Frame Analyzer marks the selected pixel with a crosshair and filters the API calls to display only those clear, draw, blit, or texture image update calls that affected this pixel, with the resulting pixel color shown next to each call.
- Review the pixel history in the API log. Graphics Frame Analyzer displays the pixel coordinates, pixel components, the number of times each draw call touched the pixel, and rejected draw calls. You can switch back to the color buffer to better understand the place of the selected pixel in the overall scene.
To find out the reason for draw call rejection, you can tweak the pipeline state for this draw call. For example, disable depth or stencil tests. For draw calls rejected with a scissor test or color mask, the API log shows the rejection reason automatically.
- Analyze the calls that affected the pixel to determine how to get the same or similar results at less cost:
- If you see that two API calls affecting the pixel are of the same type, you might improve performance by removing one of them. To see how much performance you can gain by removing an API call, select it, and check the Disable Event(s) check box in the Experiments tab.
- Detect API calls used by mistake. Remove such calls by checking the Disable Event(s) check box in the Experiments tab to see the potential performance improvement.
You can only perform the Disable Event(s) experiment if metrics data is available for your target system. Otherwise, the Experiments pane is hidden.
Scenes with many overlapping objects, or objects with semitransparent textures (such as smoke, fog, or water) often cause a high load on the graphics card and lower frame rates. If you see that the overdraw is an issue, you could try culling primitives prior to rendering, altering the draw order (so that Z-buffer tests will reject many primitives prior to rendering them with an expensive pixel shader), or using other level-of-detail optimizations that simplify the complexity of the scene.