The following diagram illustrates how OpenGL processes data. As shown, commands enter from the left and proceed through a processing pipeline. Some commands specify geometric objects to be drawn, and others control how the objects are handled during various processing stages.
下圖說(shuō)明OpenGL如何處理數(shù)據(jù)。如圖所示,命令從左側(cè)輸入并通過(guò)處理管道繼續(xù)執(zhí)行。一些命令指定要繪制的幾何對(duì)象,另一些命令控制在不同的處理階段如何處理對(duì)象。

The processing stages in basic OpenGL operation are as follows:
OpenGL基本操作的處理階段如下:
1. Display listRather than having all commands proceed immediately through the pipeline, you can choose to accumulate some of them in a display list for processing later.
顯示列表,而不是讓所有命令都通過(guò)管道立即執(zhí)行,您可以選擇將其中一些命令累積到顯示列表中,以便稍后處理。
2. EvaluatorThe evaluator stage of processing provides an efficient way to approximate curve and surface geometry by evaluating polynomial commands of input values.
求值器處理求值器階段通過(guò)求輸入值的多項(xiàng)式命令,提供了一種近似曲線和曲面幾何的有效方法。
3. Per-vertex operations and primitive assemblyOpenGL processes geometric primitivespoints, line segments, and polygonsall of which are described by vertices. Vertices are transformed and lit, and primitives are clipped to the viewport in preparation for rasterization.
OpenGL處理幾何原語(yǔ)點(diǎn)、線段和多邊形,所有這些都是由頂點(diǎn)描述的。頂點(diǎn)被轉(zhuǎn)換和點(diǎn)亮,原語(yǔ)被裁剪到視圖端口,為柵格化做準(zhǔn)備。
4. RasterizationThe rasterization stage produces a series of frame-buffer addresses and associated values using a two-dimensional description of a point, line segment, or polygon. Each fragment so produced is fed into the last stage, per-fragment operations.
光柵化階段使用點(diǎn)、線段或多邊形的二維描述生成一系列幀緩沖區(qū)地址和相關(guān)值。這樣生成的每個(gè)片段都被送入最后一個(gè)階段,即每個(gè)片段操作。
5. Per-fragment operationsThese are the final operations performed on the data before it is stored as pixels in the framebuffer.
每個(gè)片段操作這些是在數(shù)據(jù)作為像素存儲(chǔ)在framebuffer之前對(duì)數(shù)據(jù)執(zhí)行的最后操作。
Per-fragment operations include conditional updates to the framebuffer based on incoming and previously stored z values (for z buffering) and blending of incoming pixel colors with stored colors, as well as masking and other logical operations on pixel values.
每個(gè)片段操作包括根據(jù)傳入的和先前存儲(chǔ)的z值(用于z緩沖)對(duì)framebuffer進(jìn)行條件更新,并將傳入的像素顏色與存儲(chǔ)的顏色混合,以及對(duì)像素值進(jìn)行屏蔽和其他邏輯操作。
Data can be input in the form of pixels rather than vertices. Data in the form of pixels, such as might describe an image for use in texture mapping, skips the first stage of processing described above and instead is processed as pixels, in the pixel operations stage. Following pixel operations, the pixel data is either:
數(shù)據(jù)可以以像素而不是頂點(diǎn)的形式輸入。像素形式的數(shù)據(jù)(例如可能描述用于紋理映射的圖像)跳過(guò)了上述處理的第一階段,而是在像素操作階段作為像素處理。以下像素操作,像素?cái)?shù)據(jù)為:
1. Stored as texture memory, for use in the rasterization stage.
存儲(chǔ)為紋理內(nèi)存,用于柵格化階段。
2. Rasterized, with the resulting fragments merged into the framebuffer just as if they were generated from geometric data.
柵格化,結(jié)果片段合并到framebuffer中,就像它們是從幾何數(shù)據(jù)生成的一樣。