1 / 81

Cs 352:

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

hakan
Télécharger la présentation

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 2D and 3D Computer Graphics

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

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

  4. Kinds of Graphics Software • Photoshop, Illustrator, etc. • 3D Modeling (CAD, animation) • Rendering (ray tracing, radiosity) • Animation tools • Graphics programming APIs (OpenGL, DirectX) • Scene graph libraries • Game engines

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

  6. Ray-traced Image

  7. Intelligence Chart

  8. Nvidia: Moore's Law is Dead, Multi-core Not Future

  9. History of Interactive Graphics http://www.geeks3d.com/20080810/graphics-rendering-pipelines/

  10. OpenGL • OpenGL: a widely-used, open API for 3D graphics • Old, originally from Silicon Graphics (SGI) • Low-level, procedural (vs. scene graph retained mode) • Designed for speed, control over hardware • Need hardware support for top performance • Widely used for CAD, VR, visualization, flight simulators • Managed by non-profit “Khronos Group” consortium • Support • All major graphics cards, platforms have support • Mobile devices (iOS, Android) use an embedded version • HTML5 has experimental WebGL support • Bindings for JavaScript, Java, C#, Perl, Python, Ruby, Scheme, Visual Basic, Ada, …

  11. Graphics Only • OpenGL does not support windowing, interaction, UI, etc • It must be used with another windowing system/library such as • MS Windows—various • Cocoa • X11 • Qt • GLUT, GLFW • HTML5 JavaScript?

  12. History • GL (SGI), 1980s to early 1990s [reality engine?] • OpenGL Architecture Review Board, 1992 • Selected versions: • 1.0, 1992 (Happy Twentieth birthday!) • 1.3, 2001—better texture support • 2.0, 2004—GLSL (GL Shading Language, user programmable vertex shaders) • 3.0, 2008—plan: fundamental changes to the API—no longer state-based, requires use of GLSL 1.3. Compromise: old API deprecated (but still used) • 4.1, 2010—new geometry control, shaders, OpenGL ES 2.0 compatibility • 4.3, 2012—compatibility with OpenGL ES 3.0

  13. http://wiki.maemo.org/OpenGL-ES

  14. Refraction using vertex shaders

  15. OpenGL ES • OpenGL ES (for Embedded Systems) is a subset of OpenGL for mobile phones, consoles, etc • Common and Common Lite profiles (lite profiles are fixed-point only) • Version 2.0 released in 2007 • GLSL for shaders • Supported in iOS, Android, Maemo, WebGL, Blackberry, WebOS… • Version 3.0, 2012: texture compression, new version of GLSL ES, 32-bit floats, enhanced texturing

  16. OpenGL vs. Direct3D • Direct3D: • MS only • Used more for games • Latest versions are good • OpenGL • Used more for professional applications • Not much development until a few years ago • Mobile gaming mostly on OpenGL ES • Unreal, Unity, other game engines on OpenGL ES

  17. WebGL • OpenGL 2.0 ES in your Web browser, no plugins needed! • Supported by all major browsers except IE (Microsoft hates Web standards, OpenGL) • Working group: Apple, Google, Mozilla, Opera (not Microsoft)

  18. Other software we’ll use • POV ray-tracer • ImageMagick image manipulation library • 3D Modeling: Google's SketchUp or Blender • HTML5 Canvas element for 2D graphics • The only cross-platform environment nowadays… • Overview

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

  20. Graphics Architecture

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

  22. 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 = opacity) • Frame buffer • Depth: bits per pixel • May have 24, 32, 64, or flexible depth

  23. Display terms • Scan line • Resolution • Horizontal and vertical re-trace • Refresh, refresh rate • Interlace • NTSC, PAL, S-video, Composite • HDTV

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

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

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

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

  28. Ray Tracing Ray Tracing

  29. Ray-traced blob

  30. 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)

  31. 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> }

  32. Ray thru pixel

  33. Flat blob

  34. Bounce toward lights

  35. Shadows

  36. Shaded blob

  37. Blob with Highlights

  38. Blob with ground plane

  39. Blob with transparency

  40. Blob with refraction

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

  42. What are these made of?

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

  44. Finishes

  45. Textures

  46. Surface (Ripples)

  47. POV-Ray Primitives

  48. Constructive Solid Geometry

More Related