1 / 82

Cs 352:

Cs 352:. Interactive. 3D. Computer Graphics. This Class. Interactive 3D Graphics Programming (with a taste of 2D graphics, photorealistic, image processing, modeling, and user interfaces) Top-down approach. Course Information Syllabus Policies Platform Projects.

jana
Download Presentation

Cs 352:

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. Cs 352: Interactive 3D Computer Graphics

  2. This Class • Interactive 3D Graphics Programming • (with a taste of 2D graphics, photorealistic, image processing, modeling, and user interfaces) • Top-down approach • Course Information • Syllabus • Policies • Platform • Projects

  3. Intelligence Chart

  4. Comet Simulation COMET CRASH - Sandia supercomputer simulations of a one-kilometer comet entering Earth's atmosphere, approaching the ocean's surface, and impacting the ocean, deforming the ocean floor and creating a giant high-pressure steam explosion rising into the stratosphere. The explosion ejects comet vapor and water vapor into ballistic trajectories that spread around the globe. The New York City skyline is shown for scale.

  5. Ray-traced Image

  6. Animation • Animation Interim Examples

  7. Aspects of Graphics • Design vs. Programming • Interactive vs. Photorealistic • 2D vs. 3D • Graphics vs. image processing vs. user interfaces

  8. OpenGL Programming • OpenGL: a widely-used, open API • Old • Procedural • C vs. C++ • Accessible • Support • Need hardware support for top performance • Drivers come with Windows, Mac OS X (though Windows drivers weren’t accelerated until Vista) • Drivers available for Unix/Linux for some graphics cards (e.g. nvidia) • Use lab computers with graphics cards—or your own PC

  9. OpenGL vs. Direct3D • Direct3D: • MS only • Used more for games • Latest versions are good • OpenGL • Used more for professional applications • Cross-platform (virtually all OSs, game consoles) • Latest versions: extensions, fragment programs (aka pixel shaders) • OpenGL ES: for cell phones, etc. • We’ll use more basic features of OpenGL

  10. Other software we’ll use • POV ray-tracer • ImageMagick image manipulation library • QT 2D windowing library from Trolltech • Cross-platform • GUI toolkit: windowing, 2D and 3D graphics • Also supports networking, multimedia, XML, … • Used in KDE (“best GUI toolkit for UNIX”) • Commercial and Open Source (GPL) versions • 3D Modeling: Lightwave 3D?

  11. Chapter 1: Graphics Systems and Models • A Graphics System • Processor • Memory • Frame Buffer • Display • Input Devices • Output Devices

  12. Graphics Architecture

  13. Images • Array of pixels • Red, Green, Blue • May also have analpha value(transparency)

  14. Pixels and the Frame Buffer • Pixels: • picture elements • 3 values: RGB, 0-255 or 0-65536 or 0.0-1.0 • 4 values: RGBA (Alpha = transparency) • Frame buffer • Depth: bits per pixel • Indexed vs. true color • Uses fast, dual-ported VRAM • Bandwidth needed from VRAM to DAC (digital-to-analog converter)?

  15. Frame Buffer, LUT and DAC • Look-up table maps color index -> full color • Digital to analog converter converts R, G, and B numbers to voltages

  16. CRT Display

  17. Shadow Mask

  18. Display terms • Electron gun • Scan line • Resolution • Horizontal and vertical re-trace • Refresh, refresh rate • Interlace • Phosphor • Triad • NTSC, PAL, S-video, Composite, DV

  19. LCD Display • An unpowered LCD layer changes polarization of light

  20. Other I/O devices • Virtual • Valuators • Selectors • Physical • Mouse, keyboard • Buttons & Dials • Fancy displays • VR gear

  21. VR hardware

  22. The Human Visual System • Rods: night vision • Cones: day vision • Three types of cones, with different color sensitivity • We model andrender for itscapabilities

  23. Spectral Sensitivity • Color spectrum: 780 nm (blue)…350 nm (red)

  24. Graphics Paradigms • Modeling • Rendering • Photo-realistic: • Ray tracing • Radiosity • Interactive: • Projection – camera model • Transformations, clipping • Shading • Texture mapping • Rasterization

  25. Ray Tracing Ray Tracing

  26. Ray-traced blob

  27. How does Ray-Tracing work? • Modeling • Build a 3D model of the world • Geometric primitives • Light sources • Material properties • Simulate the bouncing of light rays • Trace ray from eye through image pixel to see what it hits • From there, bounce ray in reflection direction, towards light source, etc. • Thus, model physics of emission, reflection, transmission, etc. (backwards)

  28. Modeling the World camera { location <0, 5, -5> look_at <0, 0, 0> angle 58 } light_source { <-20, 30, -25> color red 0.6 green 0.6 blue 0.6 } blob { threshold 0.5 sphere { <-2, 0, 0>, 1, 2 } cylinder { <-2, 0, 0>, <2, 0, 0>, 0.5, 1 } cylinder { <0, 0, -2>, <0, 0, 2>, 0.5, 1 } cylinder { <0, -2, 0>, <0, 2, 0>, 0.5, 1 } pigment { color red 1 green 0 blue 0 } finish { ambient 0.2 diffuse 0.8 phong 1 } rotate <0, 20, 0> }

  29. Ray thru pixel

  30. Flat blob

  31. Bounce toward lights

  32. Shadows

  33. Shaded blob

  34. Blob with Highlights

  35. Blob with ground plane

  36. Blob with transparency

  37. Blob with refraction

  38. Types of illumination • Ambient – "light soup" that affects every point equally • Diffuse – shading that depends on the angle of the surface to the light source • Specular – 'highlights.' Falls off sharply away from the reflection direction • Example: lighting applet

  39. What are these made of?

  40. Material types • Dielectrics (non-conductors): • In body reflection, light penetrates the surface and is affected by material pigment • Highlights are the color of the light source • Examples: paint, plastic, wood, … • Conductors (metals) • No light penetrates the surface • Highlight and "body" reflection are affected equally by the material • Same color for diffuse and specular reflection

  41. Finishes

  42. Textures

  43. Surface (Ripples)

  44. POV-Ray Primitives

  45. Constructive Solid Geometry

  46. Sunsethf

  47. How to ray-trace… • Transparency? • Refraction? • Reflection? • Fog?

  48. Drawbacks of ray tracing? • Time: many rays are needed per pixel… • Up to 25 rays through each pixel • Each ray may bounce and split many times • Each ray tested for intersection with many objects • E.g. 1M pixels * 25 rays per pixel * 40 rays per ray tree * 1000 objects = 1 trillion object intersection tests… • Hard lighting • No soft shadows, inter-object diffusion, etc

  49. POV-Ray • An excellent, free ray tracer: POV-Ray • We'll use for a brief intro to ray tracing • Runs on PC, Unix, Mac, Beowolf clusters, … • Installed on the computers in the Unix lab • You may wish to install on your own computer • First "lab": make a ray-traced image of four different types of primitives, one each plastic, glass, metal, and mirrored, over checked floor

  50. Radiosity • Treat each patch as reflector and emitter of light • Each patch affects every other patch depending on distance, orientation, occlusion etc. • Let light "bounce around" for a few iterations to compute the amount of light reaching a patch

More Related