1.1.0 | 光柵化階段

目錄索引

本系列與知乎同名翻譯同步更新,原文鏈接:https://zhuanlan.zhihu.com/p/646098723
如有任何翻譯錯(cuò)誤,歡迎在評(píng)論區(qū)踹我:)!
原文對(duì)照
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:
Triangle setup.
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.

譯文
幾何處理的第三個(gè)階段是光柵化。此時(shí),我們的模型已經(jīng)有了屏幕坐標(biāo)(二維坐標(biāo)),現(xiàn)在我們必須在投影區(qū)域內(nèi)找到屏幕上物體所占據(jù)的所有像素,這個(gè)過程被稱為光柵化。光柵化可以看作是場景中的物體與屏幕上的像素之間同步的過程。
對(duì)于每個(gè)物體,光柵化程序都會(huì)執(zhí)行兩個(gè)過程:
三角形設(shè)置
三角形遍歷
三角形設(shè)置負(fù)責(zé)計(jì)算屏幕上每個(gè)三角形邊的像素坐標(biāo)信息,并將這些數(shù)據(jù)發(fā)送到三角形遍歷階段。三角形遍歷會(huì)列出每個(gè)三角形網(wǎng)格所覆蓋的像素,通過這種方式生成一組稱為“片元”的序列。需要注意的是,片元并不是真正意義上的像素。