Module 12 · A Thousand Tiny Painters

How much work is it to draw one frame of a game?

Lesson 12.2 · Millions of Pixels

Rob · Sarah · Mark

Rob gave up counting at forty.

Rob counts the dots on Sarah’s monitor, out loud, as a joke.

He gives up at forty. Sarah looks it up: 1920 across, 1080 down. Rob does the multiplication on his phone and stares at it.

Then Mark mentions his game runs at 144 frames a second, and Rob has to sit down.

The short answer

About two million pixels, each with its own lighting and color math, redrawn sixty to 144 times a second. Rob’s phone calculator agreed: that’s hundreds of millions of pixels a second, which is exactly the job a GPU’s thousands of cores were built for.

Try it yourself

Do the math a GPU does every second.

A 1080p screen is 1,920 pixels across and 1,080 down. About how many pixels is that?

What you just did has a name

Parallel processing

Parallel processing means splitting a big job into many smaller pieces and working on them at the same time.

Drawing a frame is the textbook case: each pixel’s color can be worked out on its own, so a GPU hands pixels out to thousands of cores at a time and works through the screen in waves.

Jobs that can be split this way run dramatically faster on a GPU.

A few more things

Frames per second

Games are measured in frames per second (fps). 30 fps looks okay, 60 looks smooth, and competitive players chase 144 or more. Every frame is a full redraw.

Higher resolution, more work

A 4K screen has about four times the pixels of 1080p, so the GPU does about four times the work per frame.

The CPU still sets the scene

The CPU runs the game’s logic: where everyone is, what got hit. Then it hands the GPU a list of what to draw.

Go deeper

The longer version, if you want it.

Triangles

Everything in a 3D game is built from triangles: thousands to millions of them per scene. The GPU first figures out where each triangle lands on screen, then fills in the pixels inside it, working out the color and lighting for each.

Both steps are massively parallel: every triangle and every pixel can be handled independently. That’s the job GPUs were designed around in the late 1990s, and they’ve gotten absurdly good at it.

Quick check

Why is drawing a frame a good job for parallel processing?

Let’s take it slower

Imagine a stadium doing a card stunt, where every fan holds up one colored card to make a giant picture. Nobody waits for anybody else; each person just looks at their seat number and raises the right color. The whole picture appears at once. That’s parallel processing, and a GPU is the stadium.

More examples

1

Editing a photo filter

Applying a filter changes every pixel the same way. A GPU can do the whole photo in a blink.

2

Weather forecasts

Forecasters split the sky into millions of little boxes and calculate each one at the same time. Parallel processing, on giant computers.

Back to the question

So how much work is one frame?

Show the answer

About two million pixels, each with its own lighting and color math, redrawn sixty to 144 times a second. Rob’s phone calculator agreed: that’s hundreds of millions of pixels a second, which is exactly the job a GPU’s thousands of cores were built for.

More on this: CPU vs. GPU: what’s the difference?

One last question

Which of these would you trust?

“A 1080p screen has about two million pixels.”

“A 4K screen takes about the same GPU work as 1080p.”

“Each pixel in a game can take many calculations.”

“Parallel processing means doing one step after another.”

Talk Card

Talk Card · 12.2

A 1080p screen is about two million pixels, redrawn 60 or more times a second, each with its own math. GPUs do it by working on pixels in parallel.

How Computers Work · pettigrewlab.com/learn

Next lesson