implementation of a renderer consider programs are processd by the system line & polygon,...
TRANSCRIPT
![Page 1: Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation](https://reader036.vdocuments.site/reader036/viewer/2022070413/5697bfe31a28abf838cb527c/html5/thumbnails/1.jpg)
Implementation of a Renderer
Consider Programs are processd by the system
line & polygon, outside the view volume Efficiently
Understanding of the implementation process, H/W & S/W
Extra functions Texture mapping and use of the alpha channel
![Page 2: Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation](https://reader036.vdocuments.site/reader036/viewer/2022070413/5697bfe31a28abf838cb527c/html5/thumbnails/2.jpg)
Implementation tasks
Modeling Representation of geometric object
Geometric processing Transformation & Normalization Clipping Hidden surface removal
Rasterization 2D Image, Frame buffer Anti-aliasing
Display Output Screen, Automatically H/W
![Page 3: Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation](https://reader036.vdocuments.site/reader036/viewer/2022070413/5697bfe31a28abf838cb527c/html5/thumbnails/3.jpg)
Basic implementation strategies
Object-Oriented Loop of Object
For (each object) render (object) large amount of memory object independently reguire other buffers such as depth buffer
Image-Oriented Loop of Pixel
For (each) render (pixel) need only limited display memory disadvantage - all time during the rendering process
![Page 4: Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation](https://reader036.vdocuments.site/reader036/viewer/2022070413/5697bfe31a28abf838cb527c/html5/thumbnails/4.jpg)
Implementation of transformation
Model coordinates World coordinates Camera(eye) coordinates
projection matrix Clip coordinates - fit within the clipping volume
X
Y
Z
X
Y
Z
X
Y
Z
X
Y
Z
ObjectCoords.
EyeCoords.
ClipCoords.
NormalizedDeviceCoords.
ScreenCoords.
![Page 5: Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation](https://reader036.vdocuments.site/reader036/viewer/2022070413/5697bfe31a28abf838cb527c/html5/thumbnails/5.jpg)
Implementation of transformation
Normalization device coordinates x’ = x y’ = y z’ = 0
Window(screen) coordinates
![Page 6: Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation](https://reader036.vdocuments.site/reader036/viewer/2022070413/5697bfe31a28abf838cb527c/html5/thumbnails/6.jpg)
Clipping
Definition The process of determining which primitives,
and part of primitives, fit within the clipping volume define by the application
Term Clipper, Accepted – fit within the specified view
volume Rejected, Culled – primitives that can’t appear
on the display are eliminated
![Page 7: Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation](https://reader036.vdocuments.site/reader036/viewer/2022070413/5697bfe31a28abf838cb527c/html5/thumbnails/7.jpg)
Cohen-Sutherland Clipping
8 Separate clipping region Each region assigned 4-bit binary number Outcode
bit 1 => if point above of window bit 2 => if point below of window bit 3 => if point right of window bit 4 => if point left of window
0 0 11
y ymax
x xmin
y ymin
x xmax
ymin
ymax
xmin xmax
1001 1000 1010
0001
0101 0100 0110
00100000
![Page 8: Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation](https://reader036.vdocuments.site/reader036/viewer/2022070413/5697bfe31a28abf838cb527c/html5/thumbnails/8.jpg)
Cohen-Sutherland line clipping algorithm in 3D
B4 1 if Z > Znear B5 1 if Z < Zfar
![Page 9: Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation](https://reader036.vdocuments.site/reader036/viewer/2022070413/5697bfe31a28abf838cb527c/html5/thumbnails/9.jpg)
Liang-Barsky Clipping
Parametric Line Clipping Algorithm Two define a line in the plane.
![Page 10: Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation](https://reader036.vdocuments.site/reader036/viewer/2022070413/5697bfe31a28abf838cb527c/html5/thumbnails/10.jpg)
Polygon Clipping
Cohen-Sutherland and Liang-Barsky algorithms can be applied to polygons on an edge-by-edge basis.
Sutherland and Hodgeman Concave & Convex
1
2
3
45
1
2
3
4’5’
![Page 11: Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation](https://reader036.vdocuments.site/reader036/viewer/2022070413/5697bfe31a28abf838cb527c/html5/thumbnails/11.jpg)
Sutherland-Hodgeman Polygon Clipping
Process polygon against each of the 4 boundaries in turn (left, right, bottom, top)
Top Bottom Right Left
![Page 12: Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation](https://reader036.vdocuments.site/reader036/viewer/2022070413/5697bfe31a28abf838cb527c/html5/thumbnails/12.jpg)
Other method for polygon clipping
Bounding Boxes The smallest rectangle, aligned with the
window, that contains the polygon
Clipping in the Frame buffer - scissoring