COMPUTER GRAPHICS Dr. Adam P. Anthony Lectures 22,23.

Slides:



Advertisements
Similar presentations
16.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 16 – Some Special Rendering Effects.
Advertisements

Lecture 8 Transparency, Mirroring
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Computer Graphics In4/MSc Computer Graphics Lecture Notes #15 Illumination III View Independent Rendering.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
3D Graphics Rendering and Terrain Modeling
1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.
 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Chapter 4 Digital Multimedia, 2nd edition Vector Graphics.
(conventional Cartesian reference system)
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
7M836 Animation & Rendering
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Coordinate Systems X Y Z (conventional Cartesian reference system) X Y Z.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Basic Rendering Techniques V Recognizing basic rendering techniques.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
Guilford County Sci Vis V204.01
SET09115 Intro Graphics Programming
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
1 Perception and VR MONT 104S, Spring 2008 Lecture 22 Other Graphics Considerations Review.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10: Computer Graphics Computer Science: An Overview Tenth Edition.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Computer Visualization BIM Curriculum 03. Topics  History  Computer Visualization Methods  Visualization Workflow  Technology Background.
Chapter 10: Computer Graphics
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10: Computer Graphics Computer Science: An Overview Tenth Edition.
Introducing To 3D Modeling George Atanasov Telerik Corporation
Introduction to Textures and Skins Chapter 8 & 9 3D Game Programming All-in-One By Ken Finney.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
-Global Illumination Techniques
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Game Programming 06 The Rendering Engine
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Local Illumination and Shading
1 Perception and VR MONT 104S, Fall 2008 Lecture 20 Computer Graphics and VR.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
Chapter 1 Graphics Systems and Models Models and Architectures.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Computer Graphics: Illumination
Chapter 10: Computer Graphics
Introduction to Computer Graphics
- Introduction - Graphics Pipeline
Photorealistic Rendering vs. Interactive 3D Graphics
Computer Graphics Chapter 9 Rendering.
Chapter 10 Computer Graphics
IMAGES.
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
Chapter 10: Computer Graphics
(c) 2002 University of Wisconsin
CS5500 Computer Graphics May 29, 2006
Chapter 14 Shading Models.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
CS 480/680 Computer Graphics Shading.
Presentation transcript:

COMPUTER GRAPHICS Dr. Adam P. Anthony Lectures 22,23

Overview  Tuesday:  Significance of Computer Graphics  Brief history of Computer Graphics  Overview of 3D Graphics Concepts  Modeling objects in a 3D environment  Thursday:  Rendering images  Lighting  Animation

Definition of “Graphics”  A branch of computer science that applies computer technology to produce and/or manipulate visual representations  2D vs. 3D graphics:  2D ~ photographs, paintings, signage  3D ~ ‘simulation,’ or conversion of a 3-dimensional scene on a 2-dimensional platform (screen) Step 1: design the scene (creative, artistic) Step 2: convert it to a 2-dimensional ‘photograph’ (technical) This is where we work to make images more realistic!

What’s so Great about Graphics?  Humans are very visual creatures  We use graphics/vision to:  Learn new things  Make decisions  Present/Comprehend information  Be entertained  Most people, when thinking of Graphics, think of:  Games  Movies

Graphics in Games  One Focus: ‘realism’ and detail

Graphics in Games  Another focus: creativity and fun

Graphics in Games  Yet another focus: Cinematics and Story

Graphics in Movies  Virtual + Live Action

Graphics in Movies  Fully Animated

Graphics for Learning, Decision Making  Do you learn more from something like this:

Graphics for Learning, Decision Making  Or something like this?

Graphics for Presenting/Understanding Information  Using Shading to improve medical analysis:

Some Historical Perspective  Televisions: invented around 1923  First computers: 1940 – 1943  Computers with Monitors: 1956  We knew how to produce images on a screen before computers were invented!  Why were people so interested in connecting the two?  Foresight to anticipate applications previously mentioned  TV’s only copy/reproduce images from a camera, cannot create them  Interactivity!

3D Graphics Creation  Modeling  What will be in the picture, what will it look like?  Rendering  If the model was real, and we took a picture of it, what would the picture look like?  Displaying  Saving the rendering as a bit-map image  On file: movies and pictures  On Screen: interactive applications (games, drafting tools, simulators, etc.) Most games try to Model, Render and Display 30—60 times every second!

10-15 The 3D graphics paradigm

10-16 Modeling Objects  Shape: Represented by a polygonal mesh obtained from  Traditional mathematical equations  Berzier curves and surfaces  Procedural models  Other methods being researched  Surface: Can be represented by a texture map

10-17 A polygonal mesh for a sphere

About Polygons  They are easy to model!  2-dimensional  Simple definition (connect the dots!)  They are easy to combine to make more complex shapes  2D: Like combining a square and a triangle to get a house  3D: Like a house of cards or a balsa-wood model  They don’t take up much memory either

A Bit More on Modeling  Many of us are familiar with 2D systems:  To draw a square, we can give coordinates for each corner:  Square = (3,3), (6,3), (6,0), (3,0)

3D Coordinate System  A 3D system is harder to visualize, even though we live in one!  X,Y coordinates are the ‘floor’  Add a Z coordinate that represents ‘height’  Shapes drawn the same way, specifying vertices + lengths, but obviously will be more complex  And now we can talk about cubes, spheres, etc! z y x

2D Polygon Image  Find the shapes!

3D Polygon Image  Like a house of cards—Find the shapes!

10-23 A Bezier curve

10-24 Growing a polygonal mesh for a mountain range work/graphics/proj3_2003.php

Refining Hand-Designed Models

Where We’re Headed Next Time:  We’ve only seen a single (and arguably easiest) step in creating a 3D image on a computer screen  Where we’ll go next  Lighting (shadows, bright spots, reflection, refraction)  Displaying (rasterizing)  3D accelerator cards  Funny thing, though:  90% of all graphical design work is finished after the modeling phase!  Programmers use graphics engines to take care of lighting, rasterizing, card compatability  But to be the best, you need to understand how it all works!

Drawing a 3D Object: Shape, Transformation, Rotation, Surfacing 1. Recall: 3D objects are just 2D polygons ‘glued’ together  Draw the polygonal structure at the Origin (0,0,0) using 2D Polygons  A cube could be: bottom: (0,0,0),(1,0,0),(1,1,0),(0,1,0), top: (0,0,1),(1,0,1),(1,1,1),(0,1,1) Front: (0,1,0),(1,1,0),(0,1,1),(1,1,1), back: (0,0,0),(1,0,0),(0,0,1),(1,0,1) Lside: (0,0,0),(0,1,0),(0,0,1),(0,1,1) Rside: (1,0,0),(1,1,0),(1,1,1),(1,0,1) 2. Transformation: Give the polygon a new position in the world 3. Rotation: Make the shape point in a new direction 4. Surfacing: ‘fill-in’ each polygon with a color/image z y x

Surfacing  Most systems have a ‘fill’ effect:  Pick one uniform color for every pixel inside a polygon  May also use special tools to explicitly color every pixel  Costly to produce (hiring artists)  Difficult to render (typically not an option in games), takes lots of memory  Texture Mapping  Provide an image that is applied to a polygon like wallpaper (common for brick walls, wood, grass, etc.)

Building a Scene  A scene in a 3D graphics environment consists of:  Polygon models of each object: Shape Position/Orientation Surface Coloring  A virtual ‘camera’: Includes position/orientation information  1 or more virtual light sources All have a position in the world Angles depend on the type of source: Some have full 360 o coverage Others have ‘shades’

10-30 The 3D Scene: A Virtual Photo Studio

Rendering  Take a picture of the ‘virtual’ scene with the ‘virtual’ camera, to get a REAL photograph!  Lots of mathematics are used to:  Determine which polygons are actually seen by the camera (and which are definitely not seen)  What shape a polygon will really have in the final picture Depends on the angle from which it is viewed  Which pixels in the image will represent the polygon  The color/brightness of each pixel in that polygon (lighting model)

Lighting  In the real world, when light hits a surface different portions of that light source will be:  Absorbed  Reflected  Refracted  It is the physical properties of an object that determine how light behaves on it, and, ultimately, what it will look like

Simulating Light  Imagine a source of light as an infinite number of ‘rays’ that we’ll represent as straight lines  Given a single point on an object and a single light source:  There is exactly one ray that reaches that point  To simulate absorption, reflection, refraction, we only have to perform calculations for that single point and ray  Ultimately done 1000’s of times over for each and every pixel in the picture

Simulating Reflection  Angle of incidence: angle between ray of light and the polygon  Angle of reflection: angle between reflected ray and surface, always equal to incidence

Surface Properties  Specular Surfaces  Smooth, shiny  Angle of incidence is perfect with respect to polygon’s position  Characterized by bright white reflection from light source  A purely specular surface is a mirror  Diffuse Surfaces  Surface covered in tiny, rough and random bumps  Light is still reflected, but angle of incidence is based on which ‘bump’ it hits  Characterized by a warm, uniform coloring across entire surface  Many types of cloth are purely diffuse  Most surfaces have a mixture of the two

Light: A Viewer’s Perspective  Reflected light will be viewed only if it is reflected in the camera’s direction  A specular surface creates Specular Light  Follows strict rules of reflection  Only visible if the light is ‘aimed’ at the camera  A diffuse surface creates Diffuse Light  ‘Random’ bumps ultimately guarantee that some of the light is reflected in every direction  Much more likely to reach the camera lens  Light that is reflected so many times that it doesn’t technically have a source is called Ambient Light  Like a tiny bit of light hitting a surface from all directions  A diffuse surface looks the same under a bright light, or ambient light  This is how the ‘back’ of an object can be slightly illuminated from a single light source

10-37 Specular versus diffuse light

Refraction  When a surface is semi- or totally transparent, light will pass through  When it passes, refraction will bend that light in a different direction  Bends a different amount depending on the material  Modeling this phenomenon accurately is difficult  Hence, most real-time, interactive applications favor opaque, reflective objects  Less interactive applications can use special techniques to get impressive results

More Complex Lighting Models  Sub-Surface Scattering Images provided by Penny Rheingans at UMBC

Dealing With Complex Scenes  To render an image we need to determine:  What an object looks like when viewed from a certain camera angle  How light reflects from that surface, at that angle, based on multiple light sources  Move the camera 1 millimeter to the left  Have to do all that calculating all over again!  Conclusion:  Rule out as much unnecessary work as possible! WARNING! The following material is pretty dense. Focus on the concepts, instead of the details and you’ll be fine. And please ask questions if something is unclear!!!

Clipping  Extend the view volume from the camera position using simple geometry  Anything outside the view volume will not be drawn, analyzed

Scan Conversion  Draw a line through each pixel until you reach an object  Easy for one object  Trickier: what if objects overlap?

Hidden Surface Removal  When you take a picture of someone’s face:  Can you see the back of their head?  Can you see what is on the wall behind their chest?  What about layered objects?  Hidden Surface Removal = determining which polygons are actually visible, throwing out the rest  Saves lots of time!

Painter’s Algorithm  Sort all polygons from back to front, then draw the ones in the back first  Those overlapping in front will ‘paint over’

Z-Buffer Algorithm  Similar to Painter’s algorithm, but instead of drawing whole objects, focus on determining what is drawn in each pixel  Start back to front again  For each object: Check to see if it intersects with that pixel Check to see if anything in front of it also intersects with that pixel If not, then that polygon determines the color of that pixel  Shoot a bow and arrow, draw the first thing it hits!  But we don’t program it like this because it’s less efficient Images below provided by Penny Rheingans at UMBC

Shading  Flat Shading: Add coloring effects to give depth to each individual polygon  Creates faceted appearance  Gouraud and Phong Shading: Use mathematics to estimate the original shape  Creates smooth, rounded appearance  Bump Mapping: Creates bumpy, rounded appearance

10-47 A sphere as it might appear when rendered by flat shading

10-48 A sphere as it might appear when rendered by Phong shading

10-49 A sphere as it might appear when rendered using bump mapping

Graphics Accelerators  Most computer graphics calculations involve a great deal of multiplication and addition  Transformation/Rotation  Lighting/Shading effects  Z-buffer computation  A standard processor, fast as it is, can only do 1-2 simple operations per clock cycle  But it’s also general-purpose  Graphics Cards have 100’s or 1000’s of tiny parallel processors  But all those processors can do is multiply and add!  Result: instead of doing several pixels every second, we can do several screens every second!

Advanced Lighting Models  Local Lighting Model: Does not account for light interactions among objects  Global Lighting Model: Accounts for light interactions among objects  Ray Tracing  Radiosity

10-52 Ray tracing

Ray Tracing and Radiosity Examples e_raytracing_the_end_o.php

10-54 Animation: Simulating Motion  Dynamics: Applies laws of physics to determine position of objects  Kinematics: Applies characteristics of joints and appendages to determine position of objects  Avars  Motion Capture