最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

1.0.9 | 幾何處理階段

2023-08-03 16:27 作者:GeometryGlacier  | 我要投稿

目錄索引

本系列與知乎同名翻譯同步更新,原文鏈接:https://zhuanlan.zhihu.com/p/646013778

如有任何翻譯錯(cuò)誤,歡迎在評(píng)論區(qū)踹我:)!

原文對(duì)照

The CPU requests the images that we see on our computer screen from the GPU. These requests are carried out in two main steps:

  1. The render state is configured, which corresponds to the set of stages from geometry processing up to pixel processing.

  2. And then, the object is drawn on the screen.

The geometry processing phase occurs on the GPU and is responsible for the vertex processing of our object. This phase is divided into four subprocesses which are: vertex shading, projection, clipping and screen mapping.

Fig. 1.0.9 a

When the primitives have already been assembled in the application stage, the vertex shading, more commonly known as the?vertex shader stage, handles two main tasks:

  1. It calculates the position of the vertices of the object.

  2. Transforms its position to different space coordinates so that they can be projected onto the computer screen.

Also, within this subprocess, we can select the properties that we want to pass on to the following stages. It means that within the?vertex shader stage, we can include normals, tangents, UV coordinates etc.

Projection and clipping occur as part of the process, which varies according to the properties of our camera in the scene. It is worth mentioning that the whole rendering process occurs only for those elements that are within the camera frustum, also known as the view-space.

The projection and the clipping will depend on our camera, if it is set to perspective or orthographic (parallel). To understand this process, we are going to assume that we have a Sphere in our scene, where half of it is outside the frustum of the camera, so only the area of the Sphere that lies within the frustum will be projected and subsequently clipped on the screen, that is, the area of the Sphere that is out of sight will be discarded in the rendering process.

Fig. 1.0.9 b

Once we have our clipped objects in the memory, they are subsequently sent to the screen map (screen mapping). At this stage, the three-dimensional objects that we have in our scene are transformed into screen coordinates, also known as window coordinates.

譯文

應(yīng)用階段結(jié)束后,CPU 通過(guò)兩個(gè)主要步驟向 GPU 請(qǐng)求我們?cè)陔娔X屏幕上看到的圖像:

  1. 配置渲染狀態(tài),即配置幾何處理到像素處理的一系列階段。

  2. 在屏幕上繪制圖像。

幾何階段主要負(fù)責(zé)處理模型的頂點(diǎn),發(fā)生在 GPU 上。它分為四個(gè)子階段,分別是:頂點(diǎn)著色、投影、裁剪和屏幕映射。

Fig. 1.0.9 a 頂點(diǎn)變換 - 投影 - 裁剪 - 屏幕映射

在應(yīng)用階段完成圖元裝配后,頂點(diǎn)著色階段(頂點(diǎn)著色器階段)將處理兩項(xiàng)主要任務(wù):

  1. 計(jì)算模型頂點(diǎn)的位置。

  2. 將頂點(diǎn)位置轉(zhuǎn)換到不同的坐標(biāo)空間下,以便投影到計(jì)算機(jī)屏幕上。

此外,在頂點(diǎn)著色階段中,我們還可以選擇要傳遞給后續(xù)階段的屬性。這意味著在頂點(diǎn)著色階段中,我們可以加入法線(xiàn)、切線(xiàn)、UV 坐標(biāo)等屬性。

投影和裁剪是應(yīng)用階段的一部分,根據(jù)場(chǎng)景中攝像機(jī)的屬性而有所不同。值得注意的是,整個(gè)渲染過(guò)程只針對(duì)位于攝像機(jī)視錐體(也被稱(chēng)為觀察空間)內(nèi)的模型。

投影和剪切的結(jié)果取決于場(chǎng)景中攝像機(jī)是透視相機(jī)還是正交相機(jī)。為了理解這一過(guò)程,我們現(xiàn)在假設(shè)場(chǎng)景中有一個(gè)球體,這個(gè)球體有一半位于攝像機(jī)的視錐體之外。對(duì)于這個(gè)球體而言,只有位于視錐體之內(nèi)的部分才會(huì)被投影、裁剪,最終映射到屏幕上。也就是說(shuō),球體在視錐體之外的部分將在渲染過(guò)程中被丟棄。

Fig. 1.0.9 b 無(wú)裁剪(左)與裁剪后(右)

將裁剪好的模型寫(xiě)入內(nèi)存后,就進(jìn)入到了屏幕映射階段。在屏幕映射階段,我們將場(chǎng)景中的三維物體變換到屏幕坐標(biāo)系(也被稱(chēng)為窗口坐標(biāo)系)。

1.0.9 | 幾何處理階段的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
霍邱县| 福鼎市| 屯门区| 肇东市| 鄂伦春自治旗| 青田县| 仲巴县| 思茅市| 河北省| 从化市| 雅安市| 涟源市| 云南省| 禄丰县| 延长县| 林口县| 宜兰市| 呼伦贝尔市| 堆龙德庆县| 仙桃市| 肃宁县| 信阳市| 隆昌县| 金门县| 基隆市| 将乐县| 新晃| 正安县| 鄂托克前旗| 宁海县| 平武县| 苏尼特右旗| 锦屏县| 子长县| 藁城市| 信丰县| 新丰县| 当阳市| 广东省| 博客| 黄梅县|