# Graphics cards and Games

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A frequently asked question on the Wikipedia Computing reference desk relates to how to improve the speed at which games run on various PC configurations.

I'm a games programmer and have been involved in computer graphics since the early 1980's so I'm in a reasonable position to answer this question. But it's a complex question - and rather than repeat bits of it, it's probably better to write a single, comprehensive essay. That is this!

## Under the Hood.

A simplified description of the process of drawing 3D graphics in a game is as follows:

• A description of the objects in the game is stored in the CPU's RAM.
• The CPU does some processing for things like AI, physics and animation.
• The results are described as a series of triangles that are passed to the graphics card via the graphics bus.
• Each triangle is composed of three vertices - and each vertex in turn is processed by the vertex processor (which is a part of the GPU).
• The GPU then chops up each triangle into pixels which are processed by the pixel processor.
• The pixel processor writes the pixel out to the VRAM (Video RAM).
• Soon after, the pixels are read out of VRAM and displayed on the screen.

All of these things are happening at the same time - so while one object is being processed by the CPU, the previous object is being sent to the graphics card - and the object before that is being vertex-processed while previous triangles are being pixel-processed and written into VRAM.

## Find the Bottleneck.

The trouble with understanding what's going on is that any one of those stages of the processing might be the weak link in the chain that'll cause a bottleneck. It's just like traffic driving down a freeway - it doesn't matter that there is a 70mph speed limit down most of the road - if there is a 10mph traffic jam - then gradually the cars will back up behind it. If one part of the diagram above is running slowly, then it doesn't matter how fast the other parts are going because they are going to run into that bottleneck.

So if you want to upgrade your PC to make games run faster, you need to understand which part is the bottleneck. If your graphics card is the bottleneck then upgrading the CPU or adding more RAM won't help. But if the CPU is running slowly then upgrading the graphics card won't help. If you have a really slow motherboard (slow RAM or a slow graphics bus) then upgrading both the CPU and the graphics card may have little benefit.

Worse still for the game player - the bottleneck may be in different places for different games. A game that does sophisticated AI and physics processing but doesn't draw particularly complex graphics may be CPU-limited - but another game that has amazing graphics but is otherwise uncomplicated, might be Pixel-processor-limited on the exact same computer.

Sadly, it's very difficult to find that bottleneck - it takes some fairly sophisticated tools and even experienced game developers sometimes have trouble figuring this out! However, there are some simple tricks we can try that will give you at least a rough idea of what's going on:

## Pixel Processing

One of the most common causes of slow gameplay is when the bottleneck is in the Pixel Processor. Fortunately, it's really easy to figure this out because the more pixels the game has to draw, the more likely the bottleneck will be in the pixel processing stage.

So, try reducing the screen resolution (or, if the game runs in a window, reduce the window size). If the game goes faster (in frames-per-second) when you reduce the screen resolution - then it's almost certain to be pixel-processor limited. If you are really interested, try plotting a graph of screen area (width times height) versus game speed (measured in milliseconds or as 1000/fps). You should find that the speed of the game at the highest resolution settings depends on the screen area - but as you reduce the resolution, there should be a 'sweet spot' at which the performance stops improving and no matter how much smaller you make the screen, the game runs at more or less the same speed. That's the best resolution to run at if you care more about speed than about quality.

Even within one game, there may be wide variation in where that sweet spot lives depending on scene content.

If that 'sweet spot' happens at a lower resolution than you can stand - then a faster graphics card is called for. If the frame rate at the 'sweet spot' is worse than you can stand - then something else is causing the problem.

## Vertex processing

It's much harder to tell if your game is vertex processing limited. If you have the screen resolution set down well below the 'sweet spot' so you are definitely not pixel processing limited. Then perhaps you can tell by whether the frame rate changes a lot when you are looking straight up at the sky - or towards the most complicated thing in the scene. If there is little or no difference then it's likely that you are CPU limited - if there is a lot of difference then probably you're either limited by the graphics bus on your motherboard or the vertex processor on the graphics card.

In some BIOS ROM's you can alter the speed of the graphics bus - for AGP graphics bus, you can sometimes force it to run at 1x, 2x, 4x, or 8x. For PCI-express, you can sometimes reduce the number of 'lanes' for the graphics card slot. If slowing it down one notch doesn't make your frame rate worse, then you aren't graphics-bus limited.

## CPU processing

The CPU can be a limiting factor for all sorts of reasons that are quite unrelated to graphics. One way to figuure this out is to use the BIOS to under-clock the CPU chip - and again, if this doesn't affect frame rates, then you aren't CPU-limited.

## Conclusion

It's actually rather unlikely that all of these tests will get you an completely clear result - but generally, cutting your display resolution is a simple, clean test that either works or doesn't work and which tells you a lot about what's going on.