有助于理解GPU渲染管线中几个坐标系的一些资料片段

      Geometrical data is passed to the graphics hardware in the context of a threedimensional
space. One of the jobs performed by the graphics hardware is to transform this data into geometry that can be drawn into a two-dimensional viewport. There are several different coordinate systems associated with the rendering pipeline—their relationships are shown in Figure 1.3. The vertices of a model are typically stored in object space, a coordinate system that is local to the particular model and used only by that model. The position and orientation of each model are often stored in world space, a global coordinate system that ties all of the object spaces together. Before an object can be rendered, its vertices
must be transformed into camera space (also called eye space), the space in which the x and y axes are aligned to the display and the z axis is parallel to the viewing direction. (See Section 5.3.) It is possible to transform vertices from object
space directly into camera space by concatenating the matrices representing the transformations from object space to world space and from world space to camera space. The product of these transformations is called the model-view transformation.
   Once a model’s vertices have been transformed into camera space, they undergo a projection transformation that has the effect of applying perspective so that geometry becomes smaller as the distance from the camera increases. (Projections are discussed in Section 5.5.) The projection is performed in fourdimensional homogeneous coordinates, described in Section 4.4, and the space in which the vertices exist after projection is called homogeneous clip space. Homogeneous clip space is so named because it is in this space that graphics primitives are clipped to the boundaries of the visible region of the scene, ensuring that no attempt is made to render any part of a primitive that falls outside the viewport.
     In homogeneous clip space, vertices have normalized device coordinates.The term normalized pertains to the fact that the x, y, and z coordinates of each vertex fall in the range [1,1], but reflect the final positions in which they will appear in the viewport. The vertices must undergo one more transformation,called the viewport transformation, that maps the normalized coordinates to the actual range of pixel coordinates covered by the viewport. The z coordinate is usually mapped to the floating-point range [0,1], but this is subsequently scaled to the integer range corresponding to the number of bits per pixel utilized by the
depth buffer. After the viewport transformation, vertex positions are said to lie in window space.

      After multiplying the vertex position by the projection matrix the coordinates are said to be in Clip Space and after performing the perspective divide the coordinates are in NDC Space (Normalized Device Coordinates).

      The path that we have taken in this series of tutorials should now become clear. Without doing any projection we can simply output vertices from the VS whose XYZ components (of the position vector) are within the range of [-1,+1]. This will make sure they end up somewhere in the screen. By making sure that W is always 1 we basically prevent perspective divide from having any effect. After that the coordinates are transformed to screen space and we are done. When using the projection matrix the perspective divide step becomes an integral part of the 3D to 2D projection.

 

     Anyway, clipping. The short version is this: Your vertex shader returns vertex positions on homogeneous clip space. Clip space is chosen to make the equations that describe the view frustum as simple as possible; in the case of D3D, they are -w \le x \le w-w \le y \le w0 \le z \le w, and 0 < w; note that all the last equation really does is exclude the homogeneous point (0,0,0,0), which is something of a degenerate case.

 

 

引用资料:

1.http://ogldev.atspace.co.uk/www/tutorial12/tutorial12.html

2.https://fgiesen.wordpress.com/2011/07/05/a-trip-through-the-graphics-pipeline-2011-part-5/

3.Mathematics for 3D Game Programming and Computer

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值