Well today yielded one interesting new thing about WPF 3D content and how Windows XP is setup in relation to utilising the 3D classes in the new .NET 3.5 Framework. The new 3D features that are part of what was WinFX are native to Windows Vista which actually ships with all the new sparkly WPF stuff out of the box but for Windows XP things are still a way off yet.
Or so you might think …
Today I discovered that there are options for getting Windows XP to utilise some Anti Aliasing features which makes the 3D content of WPF apps really crisp and how you know you want them. At the moment I’m working on a WPF application for my employer and we are making heavy use of 3D charting components for displaying KPI information in the UI. Most of the time when you see screen shots of these new spangly WPF controls on the marketing information (designed purely to reel you in as a new customer) the charts and wotnot look all super smooth and crisp and lovely and almost edible. Well, not under XP they don’t. Under XP they actually look rather unappealing and show off all the pixels in their squarey loveliness.
Since starting looking at WPF and using some of the new controls (company will remain un-named for obvious reasons) I have become increasingly concerned with how this aliasing would effect peoples perceptions of the software we are producing and frankly it just bugged the hell out me that XP was somehow needlessly crippled in this regard.
Well, today I found the fix and it doesn’t land at the feet of your super agile 4billion megabyte SLI bridged mammoth video card. I’m using a 2.6Ghz Quad core Xeon based machine at work which comes equipped with a very capable nVidia Quadro FX570 graphics card stuffed with 256Mb of dedicated video RAM installed. This card should be able to handle pretty much anything but the insane games at their highest video demands. Either way, more than enough to render a 3 segment 3D chart displayed in a WPF applications UI.
I had played around with the nVidia control panel trying to get things looking a bit smarter but that had so far failed in creating the whizzy looking charts I had been promised. SO … drum roll please …
We need to delve into the bowels of the XP installation and add some registry keys! Basically the upshot is that its related to the XDDM format video drivers that are used my XP and older Vista format drivers. Microsoft say that adding these keys into a Windows XP registry can initiate some stability problems but after making this change to my development machine and working with 3D content most of the day I haven’t even seen a whisper of a glitch or a problem. Interestingly adding these registry keys AND switching on the nVidia Anti Aliasing cased WPF 2D content to be rendered WORSE whilst the registry keys made the 3D content look head and shoulders better. SO leave your video card settings alone and add these keys if you dare.
We are investigating this issue more thoroughly at work and we may even offer the option of turning this on during the installation of our application on Windows XP machines (with a caveat of course). I’m actually fully of the belief that provided you have a decent video card that can support DirectX 9 and a stable install of XP you shouldn’t have any problems. Anyway … you can download the .reg key files for Vista and XP/Server2K3 using the link below.
Just one thing to do before you go all gooey and download and install these keys. Check your version of DirectX by going to [Start][Run] and typing “dxdiag” this is utility that provides a summary of your current DirectX setup. Then you really should check that your card can do DirectX 9 and then download and install the updates and drivers if you are on anything other than DirectX 9. Then make a backup of your registry just to be on the safe side.