码迷,mamicode.com
首页 > 其他好文 > 详细

<OpenGL> Rasterization

时间:2016-02-18 23:10:19      阅读:609      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!