Graphics-related concepts of fixed rendering pipeline

In the process of learning this fixed rendering pipeline, we will encounter many new terms, such as own coordinate system, world coordinate system, view coordinate system, rasterization processing, primitives, back picking, cropping, projection, viewport transformation and other concepts
The rendering pipeline refers to a series of necessary operations to display images on the monitor. The specific process is as follows:

1. Own coordinate system

Modeling in the own coordinate system is not like in the world coordinate system, the position, size, and direction of the object relative to other objects must be considered.

2. World coordinate system

Once we construct various models, they are all in their own coordinate system, but we need to put them all in the same world coordinate system. The transformation of an object from its own coordinate system to the world coordinate system is called world transformation. World transformation usually uses translation, rotation, and zoom operations to set the position, size, and direction of the model in the world coordinate system. World transformation is to establish all objects through the relationship between the position, size and direction of each object in the world coordinate system.

3. View coordinate system

Transform the camera translation to the source point of the world coordinate system and rotate its direction to the positive direction of the Z axis. Of course, all objects in the world coordinate system will undergo the same transformation as the camera changes. This transformation is called the view coordinate system transformation.

4. Picking on the back

A polygon has two surfaces. We will mark one as the front and one as the back. Usually, the back surface is always invisible, because most objects in the scene are sealed. The sides of a polygon facing the camera are called front polygons, and the sides of a polygon facing away from the camera are called back polygons.

The front polygon blocks the back polygon behind it. Direct3D will improve efficiency by picking (that is, deleting the redundant processing) back polygons. This method is called back picking.

The triangle formed by the apex in the clockwise direction (in the observation coordinate system) is the front face, and the triangle formed by the counterclockwise direction is the back face.

5. Light source

The light source is defined in the world coordinate system and then transformed into the view coordinate system. The illumination exerted by the light source in the view coordinate system greatly increases the reality of the objects in the scene.

6. Cut

The process of selecting geometric figures that are beyond the scope of the visible volume is called clipping.

7. Projection

The main task of the view coordinate system is to transform a 3D scene into a 2D image representation. This process of converting from n dimensions to n-1 dimensions is called projection. There are many methods of projection, but we are only interested in a special kind of projection, which is perspective projection. Because perspective projection can make objects farther away from the camera smaller after being projected on the screen, this allows us to transform a 3D scene into a 2D image more realistically.

The essence of projection transformation is to define the visual body and project the geometric figures in the visual body onto the projection window.

8. Viewport transformation

The viewport transformation is mainly to transform the projection window to the display screen. Usually the viewport of a game is the entire display, but when we run in window mode, it may only occupy a part of the screen or in the client area.

9. Rasterization

After converting each vertex of the triangle to the screen, we drew a 2D triangle. Rasterization is to calculate the color value of each point in each triangle that needs to be displayed.

The rasterization process is a very heavy calculation, and it should be done through hardware graphics processing. The result of its processing is to display the 2D image on the monitor.

10. Graphic element

The primitives include points, lines (line columns, line bands), and faces (triangle columns, triangle bands, triangle fans)

11. Rasterization processing

Rasterization processing includes three transformations,
1. World transformation: local space → world space
2. View transformation: world space → view space
3. Projection transformation: view transformation (3D) → 2D (window)

Regarding the learning of programming, welcome everyone to follow me, comment on my articles, like, bookmark, follow me not to get lost. Netizens are also welcome to discuss dry goods with me. The knowledge of programming is much more than this, we will analyze and explain one by one. If netizens want me to explain, they can comment and leave a message, and I will do my best to explain it to everyone.

: : ProMer_Wang

Link: https://blog.csdn.net/qq_43801020/article/details/106926996

This article is the original article of ProMer_Wang, the copyright belongs to the author, please indicate the source of the original text for reprinting, welcome to reprint!

Guess you like

Origin blog.csdn.net/qq_43801020/article/details/106926996