Note: I have read a lot of information about Pipeline, I have a certain understanding for Pipeline, but I always feel that it is still modeled. It seems that it is not understanding, and there is still no relationship between them. So I am determined to write some things about PIPELINE. The process of writing is also a process of deepening understanding. The goal I need to achieve is that when I closing my eyes, I can tell the entire 3D graphics flow wire. This is a solid foundation for future graphics engine design and graphics engine optimization. Gossip is less, now enter the topic. Based on my personal understanding, I am going to divide the contents of Pipeline into two large parts: 1. Transform space. 2. Rendering / rasterization. I. The action of the transform space spatial transform is to convert the 3D scene to a region or entire screen in the 2D display screen. Different transform spaces in the second order in pipeline are: World Space-> View Space-> Culling-> Clip space (optional) -> CLIPPING-> Screen Space -> ... | | | --ModelView - | -frustum- | -projection- | --------- Viewport ------------------------------------------------------ ------------------ CPU ------------------------------- ------- | About these variations, I found a very good article on the Internet, I think it is very clear, so the relevant content is reposted here. The source of this article is:
http://www.extremetech.com/Article2/0,1558,464440,00.asp
The copyright of the article belongs to the author, I just repumented here:
Model Space: where each model is in its own coordinate system, whose origin is some point on the model, such as the right foot of a soccer player model Also, the model will typically have a control point or "handle" To move.. the model, the 3D renderer only has to move the control point, because model space coordinates of the object remain constant relative to its control point. Additionally, by using that same "handle", the object can be rotated.
View Space (also called Camera Space): in this space, the view camera is positioned by the application (through the graphics API) at some point in the 3D world coordinate system, if it is being used The world space coordinate system is then. transformed (using matrix math that we'll explore later), such that the camera (your eye point) is now at the origin of the coordinate system, looking straight down the z-axis into the scene. If world space is bypassed, then the scene is transformed directly into view space, with the camera similarly placed at the origin and looking straight down the z-axis. Whether z values are increasing or decreasing as you move forward away from the camera into the scene is up to the programmer, but for now assume that z values are increasing as you look into the scene down the z-axis. Note that culling, back-face culling, and lighting operations can be done in view space. The view volume is actually created by a projection, Which as the name suggests, "Project s the scene "in front of the camera. In this sense, it's a kind of role reversal in that the camera now becomes a projector, and the scene's view volume is defined in relation to the camera. Think of the camera as a kind of holographic projector, but instead of projecting a 3D image into air, it instead projects the 3D scene "into" your monitor. The shape of this view volume is either rectangular (called a parallel projection), or pyramidal (called a perspective projection), and this latter volume is called a view frustum (also commonly called frustrum, though frustum is the more current designation) .The view volume defines what the camera will see, but just as importantly, it defines what the camera won '
t see, and in so doing, many objects models and parts of the world can be discarded, sparing both 3D chip cycles and memory bandwidth. The frustum actually looks like an pyramid with its top cut off. The top of the inverted pyramid projection is closest to the camera's viewpoint and radiates outward. The top of the frustum is called the near (or front) clipping plane and the back is called the far (or back) clipping plane. The entire rendered 3D scene must fit between the near and far clipping planes, and also be bounded by the sides and top of the frustum. If triangles of the model (or parts of the world space) falls outside the frustum, they will not be processed. Similarly, if a triangle is partly inside and partly outside the frustrum the external portion will be clipped off at the frustum boundary, and thus the term clipping Though the view space frustum has clipping planes, clipping is actually performed when the frustum is transformed to clip space.Clip Space:. Similar to View SPAC e, but the frustum is now "squished" into a unit cube, with the x and y coordinates normalized to a range between -1 and 1, and z is between 0 and 1, which simplifies clipping calculations. The "perspective divide" performs the normalization feat, by dividing all x, y, and z vertex coordinates by a special "w" value, which is a scaling factor that we'll soon discuss in more detail. The perspective divide makes nearer objects larger, and farther objects smaller AS you.
Screen Space: where the 3D image is converted into x and y 2D screen coordinates for 2D display Note that z and w coordinates are still retained by the graphics systems for depth / Z-buffering (see Z-buffering section below) and back-. face culling before the final render. Note that the conversion of the scene to pixels, called rasterization, has not yet occurred.Because so many of the conversions involved in transforming through these different spaces essentially are changing the frame of reference, it's easy to get confused. Part of what makes the 3D pipeline confusing is that there is not one "definitive" way to perform all of these operations, since researchers and programmers have discovered different tricks and optimizations that work for them, and because there are often multiple viable Ways to Solve A Given 3D / Mathematical Problem. But, in General, The Space Conversion Process Follows The Order We Just Described. This is a completely written here. . . . . Reference: 1.http://www.extremetech.com/Article2/0, 1558, 46440,00.asp