![]() | By Sebastien St-Laurent |
![]() | ![]() | ![]() | ![]() | ![]() |
Page 154 ...section, our transformation matrix was named WorldMatrix, which implied in itself that the parameter was the world transform matrix. This also implied that you would have to stick to this precise name for each of your effects if you wanted your application to work properly. If you were to change the... | Page 92 ...emantics can easily be divided into four categories: vertex shader input, vertex shader output, pixel shader input and pixel shader output. Over the next few pages, I will present the four categories in a set of tables describing the semantics and their meaning. Keep in mind that in the tables below... | Page 111 ...e to set the proper render states, set up your textures and constants. In addition, with the proliferation of more performant video cards came the introduction of new shaders, which have put a new burden on developers who want to reach a broad audience. Not only do you want to have the best looking ... | Page 100 ...ber of components passed to this function can make a signi.cant performance difference. Another classic example of performance difference would be to use the mul function to apply skinning to a vertex using a 4-by-4 matrix when in reality a 4-by-3 matrix is needed, causing the compiler to generate 1... | Page 148 ...meter is a handle to the parameter for which you wish to check the usage. The second parameter, hTechnique, is also a simple handle pointing to the technique at which you wish to look for parameter usage. This function returns a boolean value indicating if the speci.ed parameter is used within the s... |
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:
The PIX is located at:
(SDK root)\Utilities\PIX\PIXWin.exe
The DirectX SDK contains many sample applications that can be tested with PIX. Executable sample applications are located at:
(SDK root)\Samples\C++\Direct3D\Bin
This tutorial will typically take 10-15 minutes.
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.

Figure 1. PIX Advanced View with frame trigger selection
The Advanced View (unlike the Basic View discussed in PIX Tutorial: Gathering Data in the 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:

Figure 2. PIX Advanced View with screen shot selection
Note If you need to ensure deterministic behavior in your development environment, you should run your application with the -constantframetime command-line argument when you take screen shots for comparison.
Now that you have your experiment set up, click Start Experiment. The following screen shot is generated:

Figure 3. Screen shot of ShadowVolume sample frame 1000, on a HAL device
PIX screen captures can be saved to file formats .bmp, .dds, .jpg, .png, or .tga. For more information on these formats, see D3DXIMAGE_FILEFORMAT. Use the Texture File Converter Tool to convert to and from other file formats.
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.
The experiment view should now look like this:

Figure 4. 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:

Figure 5. Screen shot of ShadowVolume sample frame 1000, on a reference device
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:

Figure 6. PIX Image Compare utility

Figure 7. Open Folder button
) and browse to the first file to use in the comparison.Alternately you can drag one or two image files onto the PIX window to display or compare the images.
The resulting display shows the RGB differences between the corresponding pixels in each of the two original images:

Figure 8. PIX Image Compare display of HAL vs. reference screen shots at frame 1000
From the PIX View menu, select Extended View to display a simultaneous view of both original images and the comparison image. If necessary, resize the Image Compare window within PIX to display all three images. Cancel the Extended View selection to display the individual images one at a time.
The Image Compare utility can act upon files in the following formats: .bmp, .emf, .exif, .gif, .icon, .jpg, .png, .tif, and .wmf.
PIX Tutorial: Gathering Data in the Basic View PIX Command-Line Options: Open an Image File in the Image Compare View IX Command-Line Options: Save a Comparison of Two Image Files