Graphics Pipelines

本文详细介绍了计算机图形学中的图形管线概念,包括DirectX11中各阶段的作用:输入组装、顶点着色、曲面细分、几何着色、光栅化、像素着色及输出合并等,并解释了这些阶段如何共同作用于将计算机指令转换为屏幕上的图形。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Graphics Pipelines

This is a smart resource. Use a QR reader or the Aurasma app to access additional content.



Introduction: What is a graphics pipeline?

The graphics pipeline is an important concept in computer graphics and it refers to the process of different stages that is used to turn the instructions on a computer into graphics on a screen.

Each API has its own pipeline but the stages used are similar as are the final results. So in order to explore the different stages within a pipeline we’ll take a look at DirectX 11.

Here’s a simplified flowchart of the stages of the pipeline. As you can see the different stages are; Input assembler, Vertex shader, Hull shader, Tessellator, Domain Shader, Geometry Shader, Rasterizer, Pixel Shader and Output Merger.


The first stage in the pipeline is the Input Assembler. This can be thought of as the building block stage. At this stage the geometry is built so that it can be rendered out later in the process.

The second stage is the vertex shader. Here is code is run that operates on each of the vertices, this generally means applying shaders. These vertices have come from the input assembler stage.


The third, fourth and fifth stages are optional and deal with tessellation. Hardware tessellation is the process of taking the original geometry and increasing or decreasing the level of detail by adding or removing faces. This means that if the hardware is powerful enough shapes can be made smoother and more detailed in real time. Here’s an example of tessellation in use.

In the image on the left you can see that the geometry is much more detailed than in the image on the right.


The sixth stage is the geometry shader and this is also an optional shader stage. Geometry shaders operate on entire shapes such as triangles and not just on vertices like with the vertex shader. At the geometry shader stage geometry can be created or destroyed as needed depending on the effect the developer is trying to create. Uses here include the generation of particles used to create effects such as rain or explosions.


The seventh stage, the rasterizer, determines what pixels are visible through clipping and culling geometry. Culling is where any geometry that does not fall within the dimensions of the rectangle representing the screen (known as the view frustum) is discarded. Clipping is where any geometry that lies partly of the view frustum is clipped and reshaped with new triangles.  This stage then sets up the pixel shaders and sorts out how they will be applied.


The eighth stage is the pixel shader stage. Here the geometry is taken from the previous stages and the pixels (often referred to as fragments because pixels are what is output on the screen) are shaded to comprise the shapes.


The output merger is the final stage in the pipeline and this is where everything from the previous stages all comes together. The final image is built using the data calculated in the earlier steps and is sent to the screen.

The staggering thing about this complicated process is that, if a game is running at 30 frames per second, then the data is sent through this pipeline 30 times every second!



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值