Tuesday, April 03, 2007

Disable Aero for better game perf in windowed mode

I've finally made the full switch to Vista. At work, at home, everywhere. Well, except for my crappy work laptop, which dies when it thinks about running Vista's eye candy goodness.

I had to wait a lot longer than I wanted to fully switch over. VS 2005 wasn't fully supported on Vista until recently, and at work, we have a critical piece of internal software that doesn't work on Vista.

That's actually a good lesson, and one that Raymond Chen would push for us all to learn. Don't use undocumented APIs* in your app, because they may go away in the next version.

So, one thing I've noticed is that Aero really slows down framerates of games, if you play in windowed mode. I personally notice this a lot with World of Warcrack, and I've heard on some internal aliases about people experiencing the same thing with their XNA apps.

Here's the fix: right click on your game executable, and select properties. Then go to the compatability tab, and check the box 'Disable Desktop Composition'. That's aero. Now, when you run the game, Vista will switch you to Vista basic, and then execute your game. When you exit the game, aero comes back.

This has been working for me for quite a while now, but there was one thing that was bothering me. Every time I switched off Aero, I got a windows alert that the color scheme had been changed to Vista Basic. I hate getting toast, and I have this compulsion to click the 'x' on toast messages. I found myself racing WoW, to click the x before the game loaded. No more! If you click in the body of the toast, you get another window, with the option to hide the toast message forever! I feel liberated. Really, I do.

Why does Aero affect frames per second (FPS) in games? I'll tell you why. Or at least, my theory why. Aero uses DirectX. Most games use DirectX. That means that when you have aero running, it's competing for resources with your game. More consumers = less resources for each one.

Normally you don't notice this, since normally, you're not using your graphics card to it's full extent. Throw in a modern 3d game, though, and your graphics card starts sweating a bit. Aero on top of the game will kill your framerates. I've seen/heard of drops of 20-30%.

So, disable Aero for better perf in games tha tyou run windowed mode.

2 comments:

Unknown said...

Just thought I'd cast some insight for you as to one main reason why aero slows down games.

If you go to the Processes tab in the task manager you will notice a new process called dwm.exe.

This process is responsible for maintaining "screenshots" of every open program so that when you hover your mouse over a program in your taskbar or use alt+tab a realtime image can be displayed.

Realtime games with high framerates keep that process pretty busy, and this consumes processor power.

Anonymous said...

Brilliant! Nice when Google's first result is actually the one thing you need. Thanks :)