1 / 39

CS 445: Introduction to Computer Graphics David Luebke University of Virginia

The Rendering Pipeline. CS 445: Introduction to Computer Graphics David Luebke University of Virginia. Admin. Call roll Forums signup. Demo. Ogre. Recap Display Technology: DMDs. Digital Micromirror Devices (projectors)

anais
Download Presentation

CS 445: Introduction to Computer Graphics David Luebke University of Virginia

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Admin • Call roll • Forums signup

  3. Demo • Ogre

  4. RecapDisplay Technology: DMDs • Digital Micromirror Devices (projectors) • Microelectromechanical (MEM) devices, fabricated with VLSI techniques

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

  6. Display Technologies: Organic LED Arrays • 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: • Thin-film deposition of organic, light-emitting molecules through vapor sublimation in a vacuum. • Dope emissive layers with fluorescent molecules to create color. • Not grown like a crystal, no high-temperature doping • Thus, easier to create large-area OLEDs

  7. Display Technologies: Organic LED Arrays • 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 • OLED cons: • Not quite there yet (96x64 displays) except niche markets • Cell phones (especially back display) • Car stereos • Not very robust, display lifetime a key issue • Currently only passive matrix displays • Passive matrix: Pixels are illuminated in scanline order (like a raster display), but the lack of phosphorescence causes flicker • 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 • Liquid Crystal On Silicon (LCOS) • “Next big thing” for projectors • Don’t know much about this one • E-Ink • Tiny black-and-white spheres embedded in matrix • Slow refresh, very high resolution • Over 200 dpi eBook devices available now in Japan • Others…

  10. 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

  11. 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

  12. Framebuffers: True-Color • A true-color(aka 24-bitor 32-bit)framebufferstores one byte each for red, green, and blue • Each pixel can thus be one of 224 colors • Pay attention toEndian-ness • How can 24-bit and 32-bit mean the same thing here?

  13. 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 colorscan a pixel be? • Still common on low-end displays (cell phones, PDAs,GameBoys) • Cute trick: color-map animation

  14. Framebuffers: Hi-Color • Hi-Color 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 216 colors • Hi-color images can exhibit worse quantization artifacts than a well-mapped 8-bit image

  15. Transform Illuminate Transform Clip Project Rasterize The Rendering Pipeline: A Whirlwind Tour Model & CameraParameters Rendering Pipeline Framebuffer Display

  16. Transform Illuminate Transform Clip Project Rasterize The Display You Know Model & CameraParameters Rendering Pipeline Framebuffer Display

  17. Transform Illuminate Transform Clip Project Rasterize The Framebuffer You Know Model & CameraParameters Rendering Pipeline Framebuffer Display

  18. Transform Illuminate Transform Clip Project Rasterize The Rendering Pipeline Model & CameraParameters Rendering Pipeline Framebuffer Display

  19. Transform Illuminate Transform Clip Project Rasterize 2-D Rendering: Rasterization(Coming Soon) Model & CameraParameters Rendering Pipeline Framebuffer Display

  20. Transform Illuminate Transform Clip Project Rasterize The Rendering Pipeline: 3-D Model & CameraParameters Rendering Pipeline Framebuffer Display

  21. The Rendering Pipeline: 3-D Scene graphObject geometry • Result: • All vertices of scene in shared 3-D “world” coordinate system • Vertices shaded according to lighting model • Scene vertices in 3-D “view” or “camera” coordinate system • Exactly those vertices & portions of polygons in view frustum • 2-D screen coordinates of clipped vertices ModelingTransforms LightingCalculations ViewingTransform Clipping ProjectionTransform

  22. The Rendering Pipeline: 3-D Scene graphObject geometry • Result: • All vertices of scene in shared 3-D “world” coordinate system • Vertices shaded according to lighting model • Scene vertices in 3-D “view” or “camera” coordinate system • Exactly those vertices & portions of polygons in view frustum • 2-D screen coordinates of clipped vertices ModelingTransforms LightingCalculations ViewingTransform Clipping ProjectionTransform

  23. 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

  24. Y X Z Rendering: Transformations • Modeling transforms • Size, place, scale, and rotate objects parts of the model w.r.t. each other • Object coordinates  world coordinates Y Z X

  25. 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

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

  27. ¢ q - q é ù é ù é ù X cos sin X = ê ú ê ú ê ú ¢ q q Y sin cos Y ë û ë û ë û Rendering: Transformations • All these transformations involve shifting coordinate systems (i.e., basis sets) • Oh yeah, that’s what matrices do… • Represent coordinates as vectors, transforms as matrices • Multiply matrices = concatenate transforms!

  28. Rendering: Transformations • Homogeneous coordinates: represent coordinates in 3 dimensions with a 4-vector • Denoted [x, y, z, w]T • 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 • Transformations are 4x4 matrices • Why? To handle translation and projection

  29. The Rendering Pipeline: 3-D Scene graphObject geometry • Result: • All vertices of scene in shared 3-D “world” coordinate system • Vertices shaded according to lighting model • Scene vertices in 3-D “view” or “camera” coordinate system • Exactly those vertices & portions of polygons in view frustum • 2-D screen coordinates of clipped vertices ModelingTransforms LightingCalculations ViewingTransform Clipping ProjectionTransform

  30. Rendering: Lighting • 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 • Interactive graphics (e.g., hardware) does only local illumination at run time

  31. The Rendering Pipeline: 3-D Scene graphObject geometry • Result: • All vertices of scene in shared 3-D “world” coordinate system • Vertices shaded according to lighting model • Scene vertices in 3-D “view” or “camera” coordinate system • Exactly those vertices & portions of polygons in view frustum • 2-D screen coordinates of clipped vertices ModelingTransforms LightingCalculations ViewingTransform Clipping ProjectionTransform

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

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

  34. Transform Illuminate Transform Clip Project Rasterize The Rendering Pipeline: 3-D Model & CameraParameters Rendering Pipeline Framebuffer Display

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

  36. Modeling: The Scene Graph • The scene graph captures transformations and object-object relationships in a DAG • Nodes are objects; • Arcs indicate instancing • Each has a matrix Robot Head Body Mouth Eye Leg Trunk Arm

  37. Modeling: The Scene Graph • Traverse the scene graph in depth-first order, concatenating transformations • Maintain a matrix stack of transformations Robot Visited Head Body Unvisited Leg Mouth Eye Trunk Arm MatrixStack Active Foot

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

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

More Related