rasterization - 计算机图形学 rasterization.pdf · rasterization •the task of displaying a...
TRANSCRIPT
![Page 1: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/1.jpg)
Rasterization
Teacher: A.prof. Chengying Gao(高成英)
E-mail: [email protected]
School of Data and Computer Science
Computer Graphics
![Page 2: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/2.jpg)
To make an image, we can...
2Computer Graphics
Drawing
Photography
![Page 3: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/3.jpg)
Two Ways to Render an Image
3Computer Graphics
In CG, drawing is... Photography is...
Ray Tracing
Rasterization
![Page 4: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/4.jpg)
Screen
4Computer Graphics
![Page 5: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/5.jpg)
Sensors
5Computer Graphics
真实物理世界没有颜色的概念,只有频率。颜色只是人的主观感受,不是物体的客观属性,物体只是在发射或反射电磁波。
![Page 6: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/6.jpg)
Rasterization
• The task of displaying a world modeled using primitives like lines, polygons,
filled/patterned area, etc. can be carried out in two steps:
• determine the pixels through which the primitive is visible,
• determine the color value to be assigned to each such pixel
6Computer Graphics
![Page 7: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/7.jpg)
Raster Graphics Packages
• The efficiency of these steps forms the main criteria to
determine the performance of a display
• The raster graphics package is typically a collection of efficient
algorithms for scan converting (rasterization) of the display
primitives
• High performance graphics workstations have most of these
algorithms implemented in hardware
• Comparison of raster graphics editors:
• https://en.wikipedia.org/wiki/Comparison_of_raster_graphics_editors
7Computer Graphics
![Page 8: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/8.jpg)
Rasterization
To convert vector data to raster format
Scan Conversion:Figure out which pixel should to shade.
8Computer Graphics
![Page 9: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/9.jpg)
Scan converting lines
9Computer Graphics
![Page 10: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/10.jpg)
Scan converting lines
10Computer Graphics
![Page 11: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/11.jpg)
Scan converting lines
11Computer Graphics
![Page 12: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/12.jpg)
Scan converting lines
12Computer Graphics
![Page 13: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/13.jpg)
Scan converting lines
13Computer Graphics
![Page 14: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/14.jpg)
Scan converting lines
14Computer Graphics
![Page 15: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/15.jpg)
Scan converting lines
15Computer Graphics
![Page 16: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/16.jpg)
Scan converting lines
16Computer Graphics
![Page 17: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/17.jpg)
Equation of Line
17Computer Graphics
![Page 18: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/18.jpg)
Digital Differential Analyzer (DDA, 数值微分法)
18Computer Graphics
![Page 19: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/19.jpg)
Digital Differential Analyzer (DDA, 数值微分法)
19Computer Graphics
![Page 20: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/20.jpg)
Digital Differential Analyzer (DDA, 数值微分法)
20Computer Graphics
![Page 21: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/21.jpg)
Digital Differential Analyzer (DDA)
21Computer Graphics
![Page 22: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/22.jpg)
Digital Differential Analyzer (DDA)
22Computer Graphics
![Page 23: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/23.jpg)
Digital Differential Analyzer (DDA)
23Computer Graphics
![Page 24: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/24.jpg)
Digital Differential Analyzer (DDA)
24Computer Graphics
![Page 25: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/25.jpg)
Digital Differential Analyzer (DDA)
25Computer Graphics
![Page 26: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/26.jpg)
Digital Differential Analyzer (DDA)
26Computer Graphics
y += 1, x += 1/m
![Page 27: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/27.jpg)
Digital Differential Analyzer (DDA)
27Computer Graphics
y += 1, x += 1/m
![Page 28: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/28.jpg)
Digital Differential Analyzer (DDA)
28Computer Graphics
y += 1, x += 1/m
![Page 29: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/29.jpg)
Digital Differential Analyzer (DDA)
29Computer Graphics
y += 1, x += 1/m
![Page 30: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/30.jpg)
Digital Differential Analyzer (DDA)
30Computer Graphics
y += 1, x += 1/m
![Page 31: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/31.jpg)
Digital Differential Analyzer (DDA)
31Computer Graphics
y += 1, x += 1/m
Divide and conquer!
![Page 32: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/32.jpg)
DDA Algorithm
32Computer Graphics
![Page 33: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/33.jpg)
Bresenham’s algorithm (布兰森汉姆算法)
• Introduced in 1967 by J. Bresenham of IBM
• Best-fit approximation under some conditions
• In DDA, only yi is used to compute yi+1, the information for
selecting the pixel is neglected
• Bresenham algorithm employs the information to constrain the
position of the next pixel
33Computer Graphics
![Page 34: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/34.jpg)
Notations
34Computer Graphics
• The line segment is from to
• Denote
• Assume that slope
• Like DDA algorithm, Bresenham Algorithm also starts from
and increases x coordinate by 1 each time
• Suppose the i-th point is
• Then the next point can only be one of the following two
![Page 35: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/35.jpg)
Criteria(判别标准)
• We will choose one which distance to the following intersection is shorter
35Computer Graphics
![Page 36: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/36.jpg)
Computation of Criteria
• The distances are respectively
36Computer Graphics
![Page 37: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/37.jpg)
Computation of Criteria
37Computer Graphics
division operation
![Page 38: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/38.jpg)
Restatement of the Criteria
38Computer Graphics
![Page 39: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/39.jpg)
Recursive for computation of pi
39Computer Graphics
![Page 40: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/40.jpg)
Summary of Bresenham Algorithm
40Computer Graphics
![Page 41: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/41.jpg)
Example
• Draw line segment (3,4)-(8,7)
41Computer Graphics
![Page 42: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/42.jpg)
2 3 4 5 6 7 8
8
7
6
5
4
3
2
0 1 (4,5)
1 -3 (5,5)
2 3 (6,6)
3 -1 (7,6)
4 5 (8,7)
注:
(Continued)
![Page 43: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/43.jpg)
More Raster Line Issues
• The coordinates of endpoints are not integer
• Generalize to draw other primitives: circles, ellipsoids
• Line pattern and thickness?
44Computer Graphics
![Page 44: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/44.jpg)
3D Bresenham algorithm
45Computer Graphics
![Page 45: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/45.jpg)
What Makes a Good Line?
• Not too jaggy
• Uniform thickness of lines at different angles
• Symmetry, Line(P,Q) = Line(Q,P)
• A good line algorithm should be fast.
46Computer Graphics
![Page 46: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/46.jpg)
Line Attributes
• line width
• dash patterns
• end caps: butt, round, square
47Computer Graphics
![Page 47: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/47.jpg)
Line Attributes
• Joins: round, bevel, miter
48Computer Graphics
![Page 48: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/48.jpg)
Scan conversion of circles
49Computer Graphics
![Page 49: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/49.jpg)
Polygon Rasterization
50Computer Graphics
![Page 50: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/50.jpg)
Scan conversion of polygon
• Polygon representation
51Computer Graphics
Polygon filling: vertex representation lattice representation
![Page 51: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/51.jpg)
Polygon filling
• fill a polygonal area --> test every pixel in the raster to see if it
lies inside the polygon.
52Computer Graphics
![Page 52: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/52.jpg)
Inside Check
53Computer Graphics
![Page 53: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/53.jpg)
Scan-line Methods
54Computer Graphics
• Makes use of the coherence properties
• Spatial coherence : Except at the boundary edges, adjacent pixels
are likely to have the same characteristics
• Scan line coherence : Pixels in the adjacent scan lines are likely to
have the same characteristics
• Uses intersections between area boundaries and scan lines to
identify pixels that are inside the area
![Page 54: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/54.jpg)
Scan Line Method
• Proceeding from left to right the intersections are paired and intervening
pixels are set to the specified intensity
• Algorithm
• Find the intersections of the scan line with all the edges in the polygon
• Sort the intersections by increasing X-coordinates
• Fill the pixels between pair of intersections
55Computer Graphics
From top to down
Discussion : How to speed up, or how to avoid calculating intersection
![Page 55: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/55.jpg)
Efficiency Issues Scan-line Methods
56Computer Graphics
![Page 56: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/56.jpg)
Special cases for Scan-line Methods
57Computer Graphics
![Page 57: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/57.jpg)
Advantages of Scan Line method
• The algorithm is efficient
• Each pixel is visited only once
• Shading algorithms could be easily integrated with this method
to obtain shaded area
• Efficient could be further improved if polygons are convex
• Much better if they are only triangles
58Computer Graphics
![Page 58: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/58.jpg)
What is Convex?
59Computer Graphics
![Page 59: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/59.jpg)
Convex Polygon Rasterization
60Computer Graphics
![Page 60: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/60.jpg)
Triangle Rasterization
61Computer Graphics
![Page 61: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/61.jpg)
Edge Walking
62Computer Graphics
![Page 62: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/62.jpg)
Edge Walking
63Computer Graphics
![Page 63: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/63.jpg)
Edge Walking Triangle
64Computer Graphics
![Page 64: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/64.jpg)
12
![Page 65: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/65.jpg)
Edge Walking
66Computer Graphics
![Page 66: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/66.jpg)
Edge Equations
67Computer Graphics
![Page 67: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/67.jpg)
Edge Equations
68Computer Graphics
![Page 68: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/68.jpg)
Edge Equations
69Computer Graphics
![Page 69: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/69.jpg)
Aliasing
70Computer Graphics
![Page 70: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/70.jpg)
Aliasing
• A classic part of the computer graphics curriculum
• Input:
• Line segment definition
• (x1, y1), (x2, y2)
• Output:
• List of pixels
71Computer Graphics
(x1, y1)
(x2, y2)
![Page 71: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/71.jpg)
Aliasing
• How Do They Look?
• So now we know how to draw lines
• But they don’t look very good:
72Computer Graphics
![Page 72: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/72.jpg)
Antialiasing
73Computer Graphics
![Page 73: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/73.jpg)
Anti-aliasing
• Application of techniques to reduce/eliminate aliasing
artifacts.
• Essentially 3 techniques:
• Super-sampling vs. filter
• We discussed a simple averaging filter
• Compute the fraction of a line that should be applied to a pixel
• Ratio method
• Area Simpling
74Computer Graphics
![Page 74: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/74.jpg)
Anti-aliasing: Super-sampling
• Technique:
1. Create an image 2x (or 4x, or 8x) bigger than the real image
2. Scale the line endpoints accordingly
3. Draw the line as before
• No change to line drawing algorithm
4. Average each 2x2 (or 4x4, or 8x8) block into a single pixel
75Computer Graphics
![Page 75: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/75.jpg)
Anti-aliasing: Super-sampling
76Computer Graphics
No antialiasing 2x2 SupersampledDownsampled to
original size
1/42/41/4
1/42/4
![Page 76: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/76.jpg)
Anti-aliasing: Ratios
77Computer Graphics
![Page 77: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/77.jpg)
Anti-aliasing: Ratios
78Computer Graphics
![Page 78: Rasterization - 计算机图形学 Rasterization.pdf · Rasterization •The task of displaying a world modeled using primitives like lines, polygons, filled/patterned area, etc](https://reader036.vdocument.in/reader036/viewer/2022071212/602443a0030685147f4591fd/html5/thumbnails/78.jpg)
Anti-aliasing (Area Sampling)
79Computer Graphics