Comparing Image Quality with PIX
Microsoft DirectX 9.0 SDK Update (October 2004)

Comparing Image Quality with PIX


This tutorial demonstrates how to use the PIX tool to generate screen shots of rendered frames, and how to compare per-pixel rendering results for frames rendered on hardware abstraction layer (HAL) and reference device types (see Device Types). The tutorial is divided into the following tasks:

Setup

The PIX tool is located at:

(SDK root)\Utilities\PIX\PIXWin.exe

The Microsoft DirectX 9.0 software development kit (SDK) contains many sample applications that can be tested with PIX. Executable sample applications are located at:

(SDK root)\Samples\C++\Direct3D\Bin

Duration

This tutorial will typically take 10-15 minutes.

Step 1: Create an Experiment to Grab a Screen Shot

Create an experiment for taking a screen capture at frame 1000 of the ShadowVolume Sample. This will require that you modify the experiment's default trigger and default action.

Launch PIX (see Step 1: Start PIX). In the PIX File menu select New Experiment. Click More Options to go into the Advanced View. In the Trigger Type selection box, select Frame. You should see the following view:

PIX Advanced View with frame trigger selection

The Advanced View (unlike the Basic View discussed in Gathering Data in the PIX Basic View) is designed to let you enter triggers and actions directly. The following procedure will allow you to capture a screen shot capture at frame 1000:

  1. Make sure the T (for Trigger) is highlighted, and then enter "1000" in the Frame box.
  2. Click the A (for Action) so that it is highlighted.
  3. In the Action Type selection box, select Grab Screenshot.
  4. In the Path to screenshot box, either click the Browse button and locate a directory where you want to save the file, or type the file's directory path in the text entry box.

PIX Advanced View with screen shot selection

Step 2: Generate a Screen Shot on a HAL Device

Now that you have your experiment set up, click Start Experiment. The following screen shot is generated:

Screen shot of ShadowVolume sample frame 1000, on a HAL device

The only supported PIX screen capture file format is .png, but the Texture File Converter Tool may be used to convert a .png file to other common formats.

Step 3: Generate a Screen Shot on a Reference Device

Now rerun the experiment with a reference device. To do this, you will need to generate another action that switches the device to a reference device.

  1. First delete the existing trigger. Select the trigger, and, on the experiment toolbar, click the X button. Alternately, right-click the existing trigger and select Delete this Trigger.
  2. Add a new trigger action by selecting Add Trigger from the Edit menu, or click the T button on the experiment toolbar.
  3. In the Trigger Type box, select Frame. The numeral 1 should appear in the Frame box immediately below.
  4. Click the action icon titled Unspecified Action, and then in Action Type, select Modify D3D Device. In Device modification, select Force REF.
  5. From the Edit menu, select Insert Trigger, or click the T button on the experiment toolbar.
  6. In this second Trigger and Action, set up a screenshot at frame 1000 just as you did in Step 1: Create an Experiment to Grab a Screen Shot.

The experiment view should now look like this:

PIX Advanced View with triggers set at frames 1 and 1000

Once again, run the experiment by clicking Start Experiment. This will generate the following screen shot using the reference device:

Screen shot of ShadowVolume sample frame 1000, on a reference device

Step 4: Compare the Screen Shots

You can view a per-pixel comparison of the screen shots to see how they differ between HAL and reference device types. Because the differences in the images are subtle, you can use the file comparison feature of PIX.

From the File menu, select Compare Images. The following user interface is displayed:

PIX Image Compare utility

  1. Click Source 1.
  2. Click the "Open Folder" button (Open Folder button) and browse to the first file to use in the comparison.
  3. Click Source 2 and browse to the second file to use in the comparison.
  4. Click Compare.

The resulting display shows the RGB differences between the corresponding pixels in each of the two original images:

PIX Image Compare display of HAL vs. reference screen shots at frame 1000



© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.