Introduction
Like most of today’s games, Valve’s Half-Life 2 automatically detects the hardware running inside your PC and configures itself to run with the appropriate settings for your hardware. On the CPU side, this includes looking for features such as MMX and SSE/SSE2, 3DNow!, while graphics hardware is checked for the presence of pixel/vertex shader-capable hardware, and if present, shading capability (i.e. DX8/DX8.1, DX9, etc).
Auto-detecting hardware is good for gamers who know little or nothing about their PC’s hardware. The typical consumer frequently knows little about the hardware within his or her PC other than the processor inside. These guys know nothing about shaders, trilinear and anisotropic filtering, or anti-aliasing. By auto-detecting their hardware, Valve can configure these settings appropriately with no intervention from the end user. This is a win-win scenario for both, as Valve can deliver the best overall gaming experience for that user’s hardware, while at the same time he doesn’t need to know all the fine details about his PC in order to play the game.
Auto detection is also good for those who don’t have the patience to tweak the plethora of visual settings present within Half-Life 2. Checkboxes for model, texture, water, and shadow detail are located within the video section’s advanced menu, while anti-aliasing and texture filtering can also be adjusted here. This still doesn’t include the console! It can all be pretty intimidating if you don’t know what any of these settings does.
Arguing the case for auto detection is an easy one, clearly it benefits all parties. But what happens if end users are forced down one set path, and aren’t allowed to adjust certain settings? This appears to be the case for GeForce FX card owners.
As we mentioned in our video stress test article, GeForce FX 5900 series cards are auto detected to run in DX8.1 mode, or at least that’s what the video – advanced menu in CS: Source beta says:
![GeForce FX and Half-Life 2: DirectX 8 only? [ DX9 card running in DX9 mode @ 1024 x 768 ] > View Full-Size in another window.](images/01-s.jpg) DX9 card running in DX9 mode
|
|
![GeForce FX and Half-Life 2: DirectX 8 only? [ Now the DX9 card is running in DX8 @ 1024 x 768 ] > View Full-Size in another window.](images/02-s.jpg) Now the DX9 card is running in DX8
|
|
At the time we didn’t know how to force the GeForce FX 5950 Ultra we were using for testing into DX9 mode, or force the RADEON 9800 XT to run DirectX 8.1, but thanks to one reader, Cas Bitton, we now have the console commands:
DirectX 9: mat_dxlevel 90
DirectX 8.1: mat_dxlevel 81
DirectX 8.0: mat_dxlevel 80
DirectX 7.0: mat_dxlevel 70
DirectX 6.0: mat_dxlevel 60
DirectX 5.0: mat_dxlevel 50
In order to appeal to the widest range of gamers possible, Valve has implemented codepaths for a wide variety of hardware. Based on the console commands above, even RIVA 128/TNT’s, Rage 128s, and Voodoo cards should be capable of running Half-Life 2 on some level. Here are the default settings for GeForce FX and newer RADEON cards:
| Shader usage in Half-Life 2 |
| Card |
Default Shader Level |
| RADEON X800 series |
9.0 |
| RADEON X600/X300 series |
9.0 |
| RADEON 9800 series |
9.0 |
| RADEON 9700 series |
9.0 |
| RADEON 9600/9500 series |
9.0 |
| RADEON 8500/9000/9100/9200 |
8.1 |
| GeForce 6800 series |
9.0 |
| GeForce FX 5900/5800 series |
8.1 |
| GeForce FX 5700/5600 series |
8.0 |
| GeForce FX 5200 series |
8.0 |
| GeForce 4 Ti series |
8.0 |
With this information in hand, we now had everything we needed to force whatever code path we wanted on GeForce FX, or any other card for that matter.