How does a GPU work, how does it help with painting pixels on the screen? How do better gpu’s paint these pixels faster?

255 views

No matter how stunning the content you’re rendering, isn’t it a set amount of colored pixels per frame, per second? Or is it different than that

In: 3

3 Answers

Anonymous 0 Comments

The hard part is not getting the picture onto the screen. That’s the easy part. The hard part is literally creating the contents of that picture from scratch *every single frame*.

In the real world, we have light rays bouncing off of stuff in all directions all the time. All you need is some kind of camera that can capture those light rays and record them onto something like film. From there, you can deduce a record of where things were and what was going on at the time the picture was taken.

In a video game, you kind of have the opposite problem. The computer knows exactly where everything is in the game world at any given time, including the camera. But there is no freebie light rays bouncing around to collect. So the camera can’t really “see” anything. There’s no “picture” to take.

The GPU’s job is to simulate those light rays in real-time. In the real world, light rays are emitted from light sources, reflected by objects, and some of that light makes it to the camera. Calculating the paths of light rays that miss the camera completely would be calculation time wasted, so GPUs typically work in reverse. They shoot rays out from the camera to hit stuff, and then try to back-calculate what light sources they may have came from to determine what color and brightness that bounced-off surface should be.

Simulating accurate optical physics to a realistic degree, 60 times every second, for enough pixels to cover a 4K display is no joke. That takes a horrendous amount of math operations. If you assigned a general-purpose CPU to this task, it would be utterly swamped. So we design custom-built chips that do *only* this task, and do it extremely well, at the cost of sucking at almost everything else. That’s a GPU.

You are viewing 1 out of 3 answers, click here to view all answers.