Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 445: Introduction to Computer Graphics David Luebke University of Virginia The Rendering Pipeline.

Similar presentations


Presentation on theme: "CS 445: Introduction to Computer Graphics David Luebke University of Virginia The Rendering Pipeline."— Presentation transcript:

1 CS 445: Introduction to Computer Graphics David Luebke University of Virginia The Rendering Pipeline

2 Admin l Call roll l Forums signup

3 Demo l Ogre

4 Recap Display Technology: DMDs l Digital Micromirror Devices (projectors) –Microelectromechanical (MEM) devices, fabricated with VLSI techniques

5 Recap: Display Technology: DMDs l DMDs are truly digital pixels l Vary grey levels by modulating pulse length l Color: multiple chips, or color-wheel l Great resolution l Very bright l Flicker problems

6 Display Technologies: Organic LED Arrays l Organic Light-Emitting Diode (OLED) Arrays –The display of the future? Many think so. –OLEDs function like regular semiconductor LEDs –But with thin-film polymer construction: n Thin-film deposition of organic, light-emitting molecules through vapor sublimation in a vacuum. n Dope emissive layers with fluorescent molecules to create color. n Not grown like a crystal, no high-temperature doping n Thus, easier to create large-area OLEDs

7 Display Technologies: Organic LED Arrays l OLED pros: –Transparent –Flexible –Light-emitting, and quite bright (daylight visible) –Large viewing angle –Fast (< 1 microsecond off-on-off) –Can be made large or small

8 Display Technologies: Organic LED Arrays l OLED cons: –Not quite there yet (96x64 displays) except niche markets n Cell phones (especially back display) n Car stereos –Not very robust, display lifetime a key issue –Currently only passive matrix displays n Passive matrix: Pixels are illuminated in scanline order (like a raster display), but the lack of phosphorescence causes flicker n Active matrix: A polysilicate layer provides thin film transistors at each pixel, allowing direct pixel access and constant illumination See http://www.howstuffworks.com/lcd4.htm for more info –Hard to compete with LCDs, a moving target

9 Display Technologies: Other l Liquid Crystal On Silicon (LCOS) –“Next big thing” for projectors –Don’t know much about this one l E-Ink –Tiny black-and-white spheres embedded in matrix –Slow refresh, very high resolution –Over 200 dpi eBook devices available now in Japan l Others…

10 Framebuffers l So far we’ve talked about the physical display device l How does the interface between the device and the computer’s notion of an image look? l 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

11 Framebuffers l So far we’ve talked about the physical display device l How does the interface between the device and the computer’s notion of an image look? l 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

12 Framebuffers: True-Color l A true-color (aka 24-bit or 32-bit) framebuffer stores one byte each for red, green, and blue l Each pixel can thus be one of 2 24 colors l Pay attention to Endian-ness l How can 24-bit and 32-bit mean the same thing here?

13 Framebuffers: Indexed- Color l An indexed-color (8-bit or PseudoColor) framebuffer stores one byte per pixel (also: GIF image format) l This byte indexes into a color map: l How many colors can a pixel be? l Still common on low-end displays (cell phones, PDAs, GameBoys) l Cute trick: color-map animation

14 Framebuffers: Hi-Color l Hi-Color was a popular PC SVGA standard l Packs pixels into 16 bits: –5 Red, 6 Green, 5 Blue (why would green get more?) –Sometimes just 5,5,5 l Each pixel can be one of 2 16 colors l Hi-color images can exhibit worse quantization artifacts than a well-mapped 8-bit image

15 The Rendering Pipeline: A Whirlwind Tour Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay

16 The Display You Know Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay

17 The Framebuffer You Know Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay

18 The Rendering Pipeline Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay

19 2-D Rendering: Rasterization (Coming Soon) Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay

20 The Rendering Pipeline: 3-D Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay

21 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

22 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

23 Rendering: Transformations l So far, discussion has been in screen space l But model is stored in model space (a.k.a. object space or world space) l Three sets of geometric transformations: –Modeling transforms –Viewing transforms –Projection transforms

24 Rendering: Transformations l 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

25 Rendering: Transformations l Viewing transform –Rotate & translate the world to lie directly in front of the camera n Typically place camera at origin n Typically looking down -Z axis –World coordinates  view coordinates

26 Rendering: Transformations l Projection transform –Apply perspective foreshortening n Distant = small: the pinhole camera model –View coordinates  screen coordinates

27 Rendering: Transformations l All these transformations involve shifting coordinate systems (i.e., basis sets) l Oh yeah, that’s what matrices do… l Represent coordinates as vectors, transforms as matrices l Multiply matrices = concatenate transforms!                     Y X Y X   cossin cos

28 Rendering: Transformations l Homogeneous coordinates: represent coordinates in 3 dimensions with a 4-vector –Denoted [x, y, z, w] T n Note that w = 1 in model coordinates –To get 3-D coordinates, divide by w: [x’, y’, z’] T = [x/w, y/w, z/w] T l Transformations are 4x4 matrices l Why? To handle translation and projection

29 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

30 Rendering: Lighting l Illuminating a scene: coloring pixels according to some approximation of lighting –Global illumination: solves for lighting of the whole scene at once –Local illumination: local approximation, typically lighting each polygon separately l Interactive graphics (e.g., hardware) does only local illumination at run time

31 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

32 Rendering: Clipping l Clipping a 3-D primitive returns its intersection with the view frustum:

33 Rendering: Clipping l Clipping is tricky! –We will have a whole assignment on clipping In: 3 vertices Out: 6 vertices Clip In: 1 polygon Out: 2 polygons

34 The Rendering Pipeline: 3-D Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay

35 Modeling: The Basics l Common interactive 3-D primitives: points, lines, polygons (i.e., triangles) l Organized into objects –Collection of primitives, other objects –Associated matrix for transformations l Instancing: using same geometry for multiple objects –4 wheels on a car, 2 arms on a robot

36 Modeling: The Scene Graph l The scene graph captures transformations and object-object relationships in a DAG l Nodes are objects; l Arcs indicate instancing –Each has a matrix Robot BodyHead ArmTrunkLegEyeMouth

37 Modeling: The Scene Graph l Traverse the scene graph in depth-first order, concatenating transformations l Maintain a matrix stack of transformations ArmTrunk Leg EyeMouth HeadBody Robot Foot Matrix Stack Visited Unvisited Active

38 Modeling: The Camera l Finally: need a model of the virtual camera –Can be very sophisticated n Field of view, depth of field, distortion, chromatic aberration… –Interactive graphics (OpenGL): n Camera pose: position & orientation n Captured in viewing transform (i.e., modelview matrix) n Pinhole camera model n Field of view n Aspect ratio n Near & far clipping planes

39 Modeling: The Camera l Camera parameters (FOV, etc) are encapsulated in a projection matrix –Homogeneous coordinates  4x4 matrix! –See OpenGL Appendix F for the matrix l The projection matrix premultiplies the viewing matrix, which premultiplies the modeling matrices –Actually, OpenGL lumps viewing and modeling transforms into modelview matrix


Download ppt "CS 445: Introduction to Computer Graphics David Luebke University of Virginia The Rendering Pipeline."

Similar presentations


Ads by Google