《Unity着色器圣经》1.1.0 | 光栅化阶段

目录索引

译文

几何处理的第三个阶段是光栅化。此时,我们的模型已经有了屏幕坐标(二维坐标),现在我们必须在投影区域内找到屏幕上物体所占据的所有像素,这个过程被称为光栅化。光栅化可以看作是场景中的物体与屏幕上的像素之间同步的过程。

对于每个物体,光栅化程序都会执行两个过程:

  1. 三角形设置
  2. 三角形遍历

三角形设置负责计算屏幕上每个三角形边的像素坐标信息,并将这些数据发送到三角形遍历阶段。三角形遍历会列出每个三角形网格所覆盖的像素,通过这种方式生成一组称为“片元”的序列。需要注意的是,片元并不是真正意义上的像素。


原文对照

Our third stage corresponds to the rasterization. At this point, our objects have screen coordinates (2D coordinates), and now we must look for the pixels in the projection area. The process of finding all the pixels that are occupied by an on-screen object is called rasterization. This process can be seen as a step of synchronization between the objects in our scene and the pixels on the screen.

For each object, the rasterizer performs two processes:

  1. Triangle setup.
  2. Triangle traversal.

Triangle setup is in charge of generating the data that will be sent to the triangle traversal. It includes the equations for the edges of an object on the screen. The triangle traversal lists the pixels that are covered by the area of the polygon object. In this way, a group of pixels called “fragments” is generated. However, this word is used many times to refer to an individual pixel.

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容