首页 > 其他 > 详细

<OpenGL> Rasterization

时间:2016-02-18 23:07:07      阅读:430      评论:0      收藏:0      [点我收藏+]

1. Definition

Rasterization is the process by which a primitive is converted to a two-dimensional image. Each point of this image contains such information as color and depth. Thus, rasterizing a primitive consists of two parts. The first is to determine which squares of an integer grid in window coordinates are occupied by the primitive. The second is assigning a color and a depth value to each such square. The results of this process are passed on to the next stage of the GL (per-fragment operations), which uses the information to update the appropriate locations in the framebuffer. Figure 3.1 diagrams the rasterization process.

技术分享

 

2. Rasterization with point

The rasterization of points is controlled with

void PointSize ( float size ) ; 

size specifies the width or diameter of a point. The default value is 1.0. A value less than or equal to zero results in the errorINVALID_VALUE.

Point antialiasing is enabled or disabled by calling Enable or Disable with the symbolic constant POINT_SMOOTH. The default state is for point antialiasing to be disabled.

 

3. Rasterization with line segment

A line segment results from a line strip Begin / End object, a line loop, or a series of separate line segments. Line segment rasterization is controlled by several variables. Line width, which may be set by calling

void LineWidth ( float width );


Method 1: Digital Differential Analyzer (DDA)

Method 2: Bresenham line algorithm (Only support lines with both endpoints on integer points of pixel grid.)

Antialiasing: Wu‘s algorithm

 

4. 

 

<OpenGL> Rasterization

原文:http://www.cnblogs.com/mjust/p/5199486.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!