Download presentation
Presentation is loading. Please wait.
Published byBenedict Moris Craig Modified over 9 years ago
1
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003
2
David Luebke 2 10/31/2015 Admin ● Call roll ● Assignment 0: questions?
3
David Luebke 3 10/31/2015 Framebuffers ● So far we’ve talked about the physical display device ● How does the interface between the device and the computer’s notion of an image look? ● Framebuffer: A memory array in which the computer stores an image ■ On most computers, separate memory bank from main memory (why?) ■ Many different variations, motivated by cost of memory
4
David Luebke 4 10/31/2015 Framebuffers: True-Color ● A true-color (aka 24-bit or 32-bit) framebuffer stores one byte each for red, green, and blue ● Each pixel can thus be one of 2 24 colors ● Pay attention to Endian-ness ● How can 24-bit and 32-bit mean the same thing here?
5
David Luebke 5 10/31/2015 Framebuffers: Indexed-Color ● An indexed-color (8-bit or PseudoColor) framebuffer stores one byte per pixel (also: GIF image format) ● This byte indexes into a color map: ● How many colors can a pixel be? ● Still common on low-end displays (cell phones, PDAs, GameBoys) ● Cute trick: color-map animation
6
David Luebke 6 10/31/2015 Framebuffers: Hi-Color ● Hi-Color is/was a popular PC SVGA standard ● Packs pixels into 16 bits: ■ 5 Red, 6 Green, 5 Blue (why would green get more?) ■ Sometimes just 5,5,5 ● Each pixel can be one of 2 16 colors ● Hi-color images can exhibit worse quantization artifacts than a well-mapped 8-bit image
7
David Luebke 7 10/31/2015 Recap: Matrices ● By convention, matrix element M rc is located at row r and column c: ● By (OpenGL) convention, vectors are columns:
8
David Luebke 8 10/31/2015 Recap: Matrices ● Matrix-vector multiplication applies a linear transformation to a vector: ● Recall how to do matrix multiplication
9
David Luebke 9 10/31/2015 Recap: Matrix Transformations ● A sequence or composition of linear transformations corresponds to the product of the corresponding matrices ■ Note: the matrices to the right affect vector first, e.g: rotation about x, then translation along y, then rotation about z ■ Note: order of matrices matters! ● The identity matrix I has no effect in multiplication ● Some (not all) matrices have an inverse:
10
David Luebke 10 10/31/2015 Vectors and Matrices ● Vector algebra operations can be expressed in this matrix form ■ Dot product: ■ Cross product: ○ Note: use right-hand rule!
11
David Luebke 11 10/31/2015 The Rendering Pipeline: A Whirlwind Tour Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay
12
David Luebke 12 10/31/2015 The Display You Know Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay
13
David Luebke 13 10/31/2015 The Framebuffer You Know Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay
14
David Luebke 14 10/31/2015 The Rendering Pipeline Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay
15
David Luebke 15 10/31/2015 2-D Rendering: Rasterization (Coming Soon) Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay
16
David Luebke 16 10/31/2015 The Rendering Pipeline: 3-D Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay
17
David Luebke 17 10/31/2015 The Rendering Pipeline: 3-D Modeling Transforms Scene graph Object geometry Lighting Calculations Viewing Transform Clipping Projection Transform Result: All vertices of scene in shared 3-D “world” coordinate system All vertices of scene in shared 3-D “world” coordinate system Vertices shaded according to lighting model Vertices shaded according to lighting model Scene vertices in 3-D “view” or “camera” coordinate system Scene vertices in 3-D “view” or “camera” coordinate system Exactly those vertices & portions of polygons in view frustum Exactly those vertices & portions of polygons in view frustum 2-D screen coordinates of clipped vertices 2-D screen coordinates of clipped vertices
18
David Luebke 18 10/31/2015 The Rendering Pipeline: 3-D Scene graph Object geometry Lighting Calculations Clipping Result: All vertices of scene in shared 3-D “world” coordinate system All vertices of scene in shared 3-D “world” coordinate system Vertices shaded according to lighting model Vertices shaded according to lighting model Scene vertices in 3-D “view” or “camera” coordinate system Scene vertices in 3-D “view” or “camera” coordinate system Exactly those vertices & portions of polygons in view frustum Exactly those vertices & portions of polygons in view frustum 2-D screen coordinates of clipped vertices 2-D screen coordinates of clipped vertices Modeling Transforms Viewing Transform Projection Transform
19
David Luebke 19 10/31/2015 Rendering: Transformations ● So far, discussion has been in screen space ● But model is stored in model space (a.k.a. object space or world space) ● Three sets of geometric transformations: ■ Modeling transforms ■ Viewing transforms ■ Projection transforms
20
David Luebke 20 10/31/2015 Rendering: Transformations ● Modeling transforms ■ Size, place, scale, and rotate objects parts of the model w.r.t. each other ■ Object coordinates world coordinates Z X Y X Z Y
21
David Luebke 21 10/31/2015 Rendering: Transformations ● Viewing transform ■ Rotate & translate the world to lie directly in front of the camera ○ Typically place camera at origin ○ Typically looking down -Z axis ■ World coordinates view coordinates
22
David Luebke 22 10/31/2015 Rendering: Transformations ● Projection transform ■ Apply perspective foreshortening ○ Distant = small: the pinhole camera model ■ View coordinates screen coordinates
23
David Luebke 23 10/31/2015 Rendering: Transformations ● All these transformations involve shifting coordinate systems (i.e., basis sets) ● That’s what matrices do… ● Represent coordinates as vectors, transforms as matrices ● Multiply matrices = concatenate transforms! Y X Y X cossin cos
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.