GPU graphics rendering pipeline Profile

(Read GPU + programming and CG + Countrymen next spring Language of Snow income summary)

GPU graphics rendering pipeline is a description of GPU rendering (the three-dimensional world is displayed as a two-dimensional image on the screen) processes can be divided into three main phases application phase, the geometric phase grating stage.

 

1. Application stage

Using high-level programming language development, and CPU, memory interaction (such as collision detection, scene graph is established, octree update, cone cutting and other classical algorithms are executed at this stage). Finally, the geometry data to the graphics hardware via the data bus.

2. geometric phase

Responsible for vertex transformation, lighting, clipping, projection and screen mapping to obtain transformed coordinates of vertices, texture coordinates, color.

 

2.1 vertex coordinates conversion space

2.1.1 from the object coordinates to world coordinates

Lighting calculations are usually carried out in world coordinates.

Vertex normal vector transformation matrix is ​​the matrix transpose matrix world inverse matrix.

 

2.1.2 from world coordinates to view coordinates

Viewpoint coordinates is a camera (or camera view) as an origin, a direction of gaze, viewing angle and distance plane, together form a three-dimensional trapezoidal body, called viewing frustum (cone). A viewpoint outside the cone portion removed.

 

2.1.3 From the viewpoint coordinates to screen coordinates space

Three steps:

1. The transformed vertices in perspective view transformation matrices from cone to CVV clip space (the specification a cube diagonal vertices are (-1, -1, -1) and (1,1,1)) , this process is what we often say that the projection;

2. FIG cutting element in the CVV;

3. The screen mapping: map the coordinates of the screen coordinate system after the process obtained.

Note: The view can also be implemented on the removal of cpu high-level language.

 

2.2 primitive assembly

The vertices of the lattice structure according to restore primitive (original connection relationship). Triangles beyond the screen to be cut, the part becomes a quadrangular saw, which is made up of two triangles.

In addition to the normal vector determined (right-hand rule), typically arranged counterclockwise vertex, if compared with the normal vector towards the front view (the normal vector direction of the viewpoint to the dot product is positive) according to the triangle vertex ordering. It will have to be opposite backface culling.

 

3. raster stage

3.1 rasterization nature coordinate transformation, discrete geometry ( dot position is rounded to an integer ). More simply, the geometric information is converted into a raster image process of a composition.

As for drawing lines and filled primitives can be found in "computer graphics."

 

3.2 pixel operations

It calculates the color of each pixel. It includes the following:

1. Declipse surface

2.Texture operation, texture operations, i.e. according to the texture coordinates of a pixel, the texture values ​​corresponding to the query

3.Blending, blending

4: Filtering, after the color is counted some Filtering (filtering or filter) outputs.

 

Guess you like

Origin www.cnblogs.com/pj2933/p/11098184.html