Einführung in Einführung in Visual Computing Visual Computing
186.822
Cli Clipping and i d A ti li Antialiasing i Werner Purgathofer - - PowerPoint PPT Presentation
Einfhrung in Einfhrung in Visual Computing Visual Computing 186.822 Cli Clipping and i d A ti li Antialiasing i Werner Purgathofer g Clipping in the Rendering Pipeline object capture/creation scene objects in object space
186.822
scene objects in object space
modeling viewing
vertex stage ( vertex shader“)
g projection
(„vertex shader )
transformed vertices in clip space clipping + homogenization transformed vertices in clip space scene in normalized device coordinates viewport transformation rasterization shading
pixel stage
Werner Purgathofer 1
raster image in pixel coordinates shading
p g („fragment shader“)
Werner Purgathofer 2
Werner Purgathofer 3
Werner Purgathofer 4
Werner Purgathofer 5
P9 P10 P4 P2 P2 P1 P6 P8 P10 P3 P1 P6 P´8
6
P7 P5 P3
6
P´5 P´7
7 7
[line clipping against a rectangular clip window]
Werner Purgathofer 6
Werner Purgathofer 7
1001 1000 1010
Window
0001 0000 0010
0101 0100 0110 0101 0100 0110
Werner Purgathofer 8
1001 1000 1010
Window
0001 0000 0010
0101 0100 0110
0101 0100 0110
Werner Purgathofer 9
P2 [lines extending from one coordinate Window P2 P”2 P’2 from one coordinate region to another may pass through Window P 2 may pass through the clip window, or they may intersect they may intersect clipping boundaries without entering the P3 P’1 without entering the window] P1 P4 P’3
Werner Purgathofer 10
Werner Purgathofer 11
P passes through li i i d Wi d P2 P” P’2 clipping window Window P 2 intersects boundaries without boundaries without entering clipping window P3 P’1 window P1 P4 P’3
Werner Purgathofer 12
[di l f l [display of a polygon [display of a correctly clipped polygon] [display of a polygon processed by a line- clipping algorithm]
Werner Purgathofer 13
clipping algorithm]
Werner Purgathofer 14
V1 V2 V2 V1 V1 V2 Vnew V V
2 1
V1 V2 V1 V2 Vnew
Werner Purgathofer 15
Sutherland-Hodgman
no yes
yes
no yes no V1 visible?
Werner Purgathofer 16
Window 3 [clipping a polygon against the left 2’ 2 against the left boundary of a window, starting with vertex 1. 1’ 2’ 1 4 starting with vertex 1. Primed numbers are used to label the points 3’ 6 1 4 used to label the points in the output vertex list for this window 5’ 3’ 5 for this window boundary]
5 4’ 5
Werner Purgathofer 17
Werner Purgathofer 18
2
Window
2
2’
2 1’ 3
2” 1’ 1
3’
[Processing the polygon vertices through a boundary-clipping
Werner Purgathofer 19
the vertex list for the clipped polygon is {1’, 2, 2’, 2”} ]
[clipping the concave polygon with the Sutherland-
Werner Purgathofer 20
[ pp g p yg Hodgeman clipper produces three connected areas]
(inside)
Werner Purgathofer 21
Werner Purgathofer 22
modeling transformation camera transformation
world space camera space
projection p j transformation viewport transformation
Werner Purgathofer 23
clip space screen space
Werner Purgathofer 24
scene objects in object space
modeling viewing
vertex stage ( vertex shader“)
g projection
(„vertex shader )
transformed vertices in clip space clipping + homogenization transformed vertices in clip space scene in normalized device coordinates viewport transformation rasterization shading
pixel stage
Werner Purgathofer 26
raster image in pixel coordinates shading
p g („fragment shader“)
Werner Purgathofer / Computergraphik 1 27
Werner Purgathofer / Computergraphik 1 28
Werner Purgathofer / Computergraphik 1 29
Werner Purgathofer / Computergraphik 1 30
Werner Purgathofer / Computergraphik 1 31
Werner Purgathofer / Computergraphik 1 32
Werner Purgathofer / Computergraphik 1 33
Werner Purgathofer / Computergraphik 1 34
Nyquist Nyquist sampling interval
interval
Werner Purgathofer / Computergraphik 1 35
max
max cycle
cycle s
max cycle
s
Werner Purgathofer / Computergraphik 1 36
Werner Purgathofer / Computergraphik 1 37
Werner Purgathofer / Computergraphik 1 38
Werner Purgathofer / Computergraphik 1 39
Werner Purgathofer / Computergraphik 1 40
Werner Purgathofer / Computergraphik 1 41
Werner Purgathofer / Computergraphik 1 42
Werner Purgathofer / Computergraphik 1 43
Werner Purgathofer / Computergraphik 1 44
Werner Purgathofer / Computergraphik 1 45
id
Werner Purgathofer / Computergraphik 1 46
Werner Purgathofer / Computergraphik 1 47
Werner Purgathofer / Computergraphik 1 48
Werner Purgathofer / Computergraphik 1 49