Intel® GPA Tip: Minimize Overdraw by Using Pixel History and Pixel Overdraw Modes

Submit New Article

January 14, 2010 10:00 PM PST


Introduction

Intel® Graphics Performance Analyzers (Intel® GPA) is a suite of software tools that allow game developers to analyze and optimize their game in order to improve the overall game-playing experience, thereby attracting a larger potential audience for your game.

Two of the more useful features within the Intel GPA Frame Analyzer tool are Pixel History and Overdraw modes. These two are often used together, and this article shows you how to use them within the application in order to optimize the rendering order or eliminate rendering passes that do not contribute to the overall playability of the game.

NOTE: Another option available to game developers for analyzing a specific frame for occluded and "wasted" geometry is to use the Erg Advisor tool within Intel GPA Frame Analyzer. To use this feature, either consult the Intel GPA Online Help, or see this article.

Minimizing Overdraw

We'll assume that your familiar with the basics of using Intel GPA System Analyzer and Intel GPA Frame Analyzer, but need to understand how Pixel History and Overdraw modes work. If you haven't used the product before, see the Intel GPA Home Page for links to product documentation.

First of all, for this example we've run Intel GPA System Analyzer to capture a representative frame from gpasample.exe (found where you installed the Intel GPA binaries) by using the keyboard shortcut for frame captures, which by default is Ctrl+Shift+C. Once the frame has been created, we'll startup Intel GPA Frame Analyzer to perform a "deep dive" into this specific frame.

To use Pixel History and Overdraw, follow these steps within Intel GPA Frame Analyzer:
  • Select one or more ergs from the Scene Overview Pane. In this example, we've selected four (two Fire Pits and two Stairway scenes).
  • Select a render target from the Render Target Viewer Panel -- In this example, we've selected RT 3560.
  • Select the Overdraw and Pixel History modes from the Render Target Viewer Panel.
  • Select a pixel location from the Render Target Viewer Panel -- here we've selected (560, 173). The lighter the color, the more that pixel has been "overdrawn", so usually you'll select a "bright" pixel.
one.png

As the screenshot above shows, all the ergs that rendered into this pixel are displayed just to the left of the image within the Tab Panel. In addition to the erg number, the tool also provides the erg type (such as DrawIndexedPrimitive), the number of times that erg touched the pixel, and the color that this erg rendered into that pixel. If the rendering engine rejected the erg's attempt to render to that pixel, an "X" is displayed instead of a color value, and the reason for not rendering is also displayed (such as Pixel was Z-rejected).

Moving through the ergs, you can see exactly what is happening for that pixel. If you see that two ergs affecting a pixel are of the same type, find out how much performance you can gain by removing one of them: select the erg, and then proceed to the Experiments Tab and select the Disable Erg(s) check box to see the difference.

Also, a common result of this analysis is that you see that a pixel is fully rendered multiple times -- that is, there are no trivial rejections of that erg (which would be indicated by an "X" for that erg). Depending upon the complexity of your shader, a different drawing order may significantly improve the rendering performance, since you don't have to fully render pixels that are simply overwritten by ergs that are drawn later (but are closer to the viewer).

But once you have identified and fixed an issue, it's a good idea to rerun the tool to see whether other areas of the scene or other render targets can also be optimized.

Extra Credit...

The following screenshot shows some additional features of the tool that may be useful:

two.png

First of all, in the upper-right corner you can see that I've selected a different X-Axis and Y-Axis metric than the default. Using these metrics it's much easier to see the ergs that take up the most time.

Next, you can zoom in/out of the Render Target Viewer window and the Pixel History window for more/less detail by using the spyglass icons (highlighted in red) in the bottom left corner of the respective windows. For a quicker method of zooming, you can also double-click in either of these two windows to automatically zoom-in for a detailed look at the scene (and then double-click again to return to the default view).

You can also quickly select all ergs that touched a selected pixel (use the Select Ergs button), or right-click on a specific erg in the Pixel History Tab and either Select only this erg or Add this erg to the selection set. You can then perform additional experiments within the Intel® GPA Frame Analyzer on all selected ergs (such as removing them in order to see the performance and visual impact of not including them).

Conclusion

The Pixel History and Overdraw modes within the Intel® GPA Frame Analyzer are useful for visually understanding the overall complexity of your scene. With this feature, you can quickly see what your game does to render each pixel, and you may be able to optimize the rendering order and/or eliminate rendering passes that do not contribute to the overall "playability" of the game.

For more information about this specific feature, consult the Help File included with the product. For more general information about Intel GPA, visit the Intel GPA® Home Page, where you can learn more about the product, including pointers to various training videos, as well as links to other important resources for the product.


* Other names and brands may be claimed as the property of others.


Do you need more help?


This article applies to: Game Development,   Intel® Graphics Performance Analyzers (Intel® GPA),   Visual Computing,   Visual Computing Source,   Intel® Graphics Performance Analyzers Knowledge Base