Computer composition principle in simple terms: GPU (on) - Why play games need GPU? (Lecture 30)

First, the primer

Finished CPU, I brought you a look at a computer in another processor, which is known as the GPU graphics processor. Over the past few years, because of the great development of deep learning, GPU suddenly fire up,
it seems designed for GPU processors become a deep learning and design. GPU architecture that is exactly how it's going children? It was first used to do what it is designed?

GPU want to understand the design, start with the line of work we have to deal with graphics GPU. Because the graphics GPU is designed to do. Only by understanding the flow of graphics processing, we can thoroughly understand
why the GPU to be designed so now; why depth study, GPU than the CPU has a big advantage.

Two, GPU historical process

As we begin GPU is required to render three-dimensional graphics appear inside the computer, and developed equipment. And a pioneer in graphics rendering device, the first to be SGI (Silicon Graphics Inc.) company.
SGI's name translated into Chinese is "Silicon Graphics." The company since the 1980s on the development of a number of operating systems based on Unix workstations. Its founder Jim Clark is a professor at Stanford, as well as graphics professionals.

Later, he also Netscape (Netscape) is one of the founders. And Netscape, IE was the man who battle and 300 rounds of browser company, although the final defeat bundled with Microsoft's Windows IE free under the policy,
but also left the Firefox browser completely managed by the open source foundation. But this is not even.

By the mid-1990s, with the PC's performance is getting better, PC gamers began to have "3D graphics" needs. Before the era of 3D games, they are actually pseudo-3D. For example, the
Great God Carmack developed by well-known Wolfenstein 3D (Wolfenstein 3D), seen from different perspectives are eight different textures, not actually rendered by the graphics rendering polygons.

Under such circumstances, gamers perspective rotated 10-degrees, see the picture has not changed. But if you turn 45 degrees, see the picture becomes another picture. And if we can real-time rendering polygon-based 3D images of words,

So a little bit of perspective any changes will be reflected in real time on the screen inside, as if, like you see in the real world inside.

In the mid-1990s, with advances in hardware and technology, we can finally direct real-time rendering polygon the hardware on the PC. "True 3D" game began to board the stage of history. "Tomb Raider," "Final Fantasy 7", these games were born in that era.
At that time, many domestic computer enthusiasts dream, it is a Voodoo FX graphics card. Why CPU performance has improved significantly, but we also need a separate GPU it? To this question, let's look at a

To see three-dimensional images of the actual computer rendered through the process.

Third, the graphics rendering process

Now we show up inside the computer screen 3D, in fact, through a combination of polygons out. You can look at this picture below, you are playing a variety of games, inside face of the person, not the camera or cameras shoot out,
but created out by polygonal modeling (PolygonModeling).

 

In these figures the actual inside of the moving picture, the operation, and even a change of light occurring, in accordance with various computer graphics are calculated out by the real-time rendering. This process for rendering images in real time, so that can be broken down into the following five steps:

1. The vertex processing (Vertex Processing)
2. FIG processing element (Primitive Processing)
3. rasterizing (Rasterization)
4. Processing fragment (Fragment Processing)
5. The operation of the pixel (Pixel Operations)

1. The vertex processing (Vertex Processing)

The first step in graphics rendering is vertex processing. Then each polygon, has a plurality of vertices (Vertex) constituting the polygon modeling. These have a vertex coordinates in three-dimensional space of. But our screen is two-dimensional,
so in determining the current perspective, we need to put these vertex position inside the three-dimensional space, transformed into the two-dimensional screen space inside. This conversion operation, it was called vertex processing.

If you learned a little a little graphics, you should know that such a transformation is performed by calculating the linear algebra. It is conceivable that our modeling about the fine, the more the number of vertices you want to convert,
calculate the amount will be. Further, there is a vertex position of each of the conversion, no dependencies between each other, can be calculated independently in parallel.

2. The process primitives (Primitive Processing)

After the vertex processing is complete it, we need to start the second step, which is the primitive processed. FIG processing element, in fact after each vertex of the vertex processing is completed even take up into polygons. In fact, after the vertex transformation
is still in a three-dimensional space, but the third dimension of the Z-axis, is positive on the screen "depth." So we focused on these polygons need to do an operation, called clipping and culling (Cull andClip), which is not on the screen inside the,
or part of the contents inside off the screen to remove, reduce the workload of the next process.

3. rasterized (Rasterization)

It, rendering is far from complete after the primitive process is completed. Our screen resolution is limited. It is generally displayed contents by one "pixel (Pixel)." So, for finish processing polygon primitives,
we want to start the third step operation. This operation is to convert them into a pixel points inside the screen. This does it, it is called rasterization. The rasterized, and has a characteristic
vertex processing is the same as above, is that every primitive can be rasterized independently in parallel.

4. Processing fragment (Fragment Processing)

After rasterized into a pixel, or our view of "black and white" is. We also need to calculate the color information, transparency of each pixel to pixel color. This operation is the fragment processing. This operation,
the same may be parallel to each segment, independently, and vertex processing and rasterizing the same as above.

5. Operation pixels (Pixel Operations)

After rasterized into a pixel, or our view of "black and white" is. We also need to calculate the color information, transparency of each pixel to pixel color. This operation is the fragment processing.
 This operation, each fragment may be similarly parallel, independent, and vertex processing and rasterizing the same as above.

After this complete five steps, we completed the rendering data from three-dimensional space, it becomes on the screen you can see the 3D animation. 5 render such process steps of it,

Generally called a graphics pipeline (Graphic Pipeline). The name and we explain the CPU inside the lines are very similar, called Pipeline.

 

 

Fourth, the liberation of GPU graphics rendering

We can think about it, if the CPU to perform the rendering process, the amount of resources required to spend it? We can make a rough estimate by some of the data.

In the 90s of last century, when the screen resolution is not as high now. CRT display is typically 640 × 480 resolution. There are 300,000 pixels required to render this means the screen.
In order for our eyes to see the screen is not dizzy, we hope to have 60 screens. So, every second we have to re-render the screen 60 times. In other words, we need to complete the second 18 million render a single pixel.
From the beginning of the grid, each pixel has three pipeline steps, each step even if only one instruction, then we need 54 million instructions, which is 54M instructions.

CPU performance in the 1990s is how much? 93-year shipments of the first-generation Pentium processor, clocked at 60MHz, follow-up and gradually introduced a processor 66MHz, 75MHz, 100MHz of. In the performance point of view,
a CPU to render 3D graphics, CPU performance should basically run out. Because the actual rendering of each step may be more than one instruction, our CPU may simply not run such a three-dimensional graphics rendering.

That is, at this time, so Voodoo FX graphics accelerator card boarded the stage of history. Since the graphics rendering process is fixed, then we directly use the hardware to handle this part of the process, not the CPU computing is not enough?
Obviously, this hardware will be manufactured with the same computing performance than the CPU is much cheaper. Because the whole calculation process is completely fixed, no pipeline stalls, all kinds of out of order and so causes the CPU computing becomes complicated.
What we do not need programmability, as long as the hardware logic operations carried out in accordance with written enough.

At that time, the entire process or vertex processing performed by the CPU, but to all subsequent primitives and to pixel-level processing is handled by the graphics card such Voodoo FX or TNT.
That is, from the beginning of this era, we can play on the "true 3D" game.

However, both the Voodoo FX or NVidia TNT. The entire graphics architecture also different from our modern graphics, nor go into such modern graphics cards Voodoo FX or TNT to handle. The ability to accelerate depth study of the various lines. The ability to raise Unified Shader Archicture NVidia to begin with. This is why we talk about the next lecture content.

V. Summary extension

This lecture, I take you through a three-dimensional graphical modeling of a polygon-based rendering process. The rendering process to go through vertex processing, primitive processing, rasterization, and a pixel fragment processing operations five steps.
This step 5 is stored in the data memory inside the polygon rendering on the screen into a screen. Because a lot of steps inside, we need to render every pixel inside the whole picture, so in fact the amount of calculation is large
of. Our CPU this time, a little not run.

So, vendors like 3dfx and NVidia launched a 3D accelerator card with hardware to complete the primitive process starts rendering process. These modern graphics accelerator card and also not the same,
they are fixed during the entire treatment process to complete the 3D graphics rendering. However, because you do not like to think like CPU computing versatility and processing power. We can use less than the cost of a CPU chip,
better complete 3D graphics rendering work. The era of 3D gaming is also from the beginning.

Guess you like

Origin www.cnblogs.com/luoahong/p/11413746.html