CS4830 Computer Graphics, Fall 2016 Professor: Dr. Mihail

Slides:



Advertisements
Similar presentations
1Computer Graphics Lecture 2 - What is Computer Graphics? John Shearer Culture Lab – space 2
Advertisements

01.1 Angel: Interactive Computer Graphics Addison-Wesley 2005 Computer Graphics: Realism comes to computer graphics smooth shadingenvironment.
1 Angel and Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 What is Computer Graphics? 靜宜大學 資訊工程系 蔡奇偉 副教授
CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics February 26, 2007.
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 What is Computer Graphics? Ed Angel Professor of Computer Science, Electrical and Computer.
Introduction to Computer Graphics Mohan Sridharan Based on Slides by Edward Angel and Dave Shreiner CS4395: Computer Graphics 1.
Image Formation Mohan Sridharan Based on slides created by Edward Angel CS4395: Computer Graphics 1.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Ch 1 Intro to Graphics page 1CS 367 First Day Agenda Best course you have ever had (survey) Info Cards Name, , Nickname C / C++ experience, EOS experience.
CSC 461: Lecture 2 1 CSC461 Lecture 2: Image Formation Objectives Fundamental imaging notions Fundamental imaging notions Physical basis for image formation.
CSE40166 (Notre Dame) Computer Graphics Lecture 1 John H Stewman 205C Cushing
1 Angel and Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 What is Computer Graphics? Sai-Keung Wong ( 黃世強 ) Computer Science National.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 46 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 46 Computer Graphics Introduction II.
Chapter 1 Graphics Systems and Models. What is Computer Graphics? Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media.
CS 480/680 Computer Graphics What is Computer Graphics Dr. Frederick C Harris, Jr.
1Computer Graphics Lecture 3 - Image Formation John Shearer Culture Lab – space 2
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics I, Fall 2008 Image Formation.
1 Image Formation. 2 Objectives Fundamental imaging notions Physical basis for image formation ­Light ­Color ­Perception Synthetic camera model Other.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Prof. Zhang Caiming (张彩明) Dr. Zhou Yuanfeng (周元峰) Shandong University
1 Chapter 1: Graphics Systems and Models Dr. Payne CSCI 3600 North Georgia College & St. Univ.
CSC 461: Lecture 1 1 Lecture 1: Introduction Objectives Explore what computer graphics is about Survey some application areas Introduce a history of computer.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
COMPUTER GRAPHICS Hochiminh city University of Technology Faculty of Computer Science and Engineering CHAPTER 01: Graphics System.
Computer Graphics I, Fall : What is Computer Graphics?
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
CS 480/680 Computer Graphics Image Formation Dr. Frederick C Harris, Jr.
Advanced Computer Graphics September 15, Grading Programming homework Paper study and presentation Final project No written exams.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
What is Computer Graphics?. 2 Objectives In this lecture, we explore what computer graphics is about We will give a historical introduction.
1 Angel and Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 What is Computer Graphics? Sai-Keung Wong ( 黃世強 ) Computer Science National.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 What is Computer Graphics?
1 Angel: Interactive Computer Graphics4E © Addison-Wesley 2005 Image Formation.
1 Angel and Shreiner: Interactive Computer Graphics6E © Addison-Wesley 2012 Image Formation 靜宜大學 資訊工程系 蔡奇偉 副教授
1 Angel and Shreiner: Interactive Computer Graphics6E © Addison-Wesley 2012 Image Formation Sai-Keung Wong ( 黃世強 ) Computer Science National Chiao Tung.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
Intro to Computer Graphics and Image Formation Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 Contact Information Wsalhalabi.kau.edu.sa Parts of the slides were adopted from Dr. Barbara Hecker.
What is Computer Graphics?
- Introduction - Graphics Pipeline
Chapter 1 An overview on Computer Graphics
Computer Graphics - Introduction -
Chapter 1 An overview on Computer Graphics
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Yuanfeng Zhou Shandong University
What is Computer Graphics?
INTERACTIVE COMPUTER GRAPHICS
What is Computer Graphics?
CS 4722 Computer Graphics and Multimedia Spring 2018
Image Formation Ed Angel Professor Emeritus of Computer Science,
Models and Architectures
Introduction to Computer Graphics with WebGL
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Isaac Gang University of Mary Hardin-Baylor
Models and Architectures
Angel: Interactive Computer Graphics4E © Addison-Wesley 2005
Image Formation Ed Angel
What is Computer Graphics?
Models and Architectures
University of New Mexico
CS 4722 Computer Graphics and Multimedia Spring 2018
Introduction to OpenGL
Presentation transcript:

CS4830 Computer Graphics, Fall 2016 Professor: Dr. Mihail Textbook and slides (modified) Interactive Computer Graphics : A Top-Down Approach with WebGL, Seventh Edition by Edward Angel and Dave Schreiner https://www.cs.unm.edu/~angel/

Syllabus and Course Web Page http://mypages.valdosta.edu/rpmihail/t eaching/F16/CS4830/syllabus/syllabu s.pdf http://mypages.valdosta.edu/rpmihail/t eaching/F16/CS4830/

Rules Please: Come in on time Ask questions during lecture Try to keep focused Put your phone away: don't text/email/browse I will ask you to leave if I see you distracted Don't copy/paste code from the Internet If you do and don't attribute (Who/What/When/Where), you will Fail this class Don't copy/paste code from a classmate Give credit where credit is due

This Course Audience: lectures geared towards an elective senior level CS course Modern: teach graphics using programmable shaders Web: With HTML5, WebGL runs in the latest browsers You will need to learn JavaScript and basic HTML

Assignments Submission will be a link to your mypages assignment Homework: Before this Thursday, upload the triangle example from the course web page to your mypages page and email me the link

Hello World In computer graphics, we draw a simple primitive (a triangle) Anatomy of a WebGL application HTML Describes pages, includes utilities, shaders JavaScript Contains graphics code Is executed internally by the browser (JavaScript engine), so no compiling needed

Triangle http://mypages.valdosta.edu/rpmihail/teaching/F15/CS4830/examples/triangle/triangle.html

Exercise Run triangle from the class web page Run it locally (download link) Edit the files to change: Color of the triangle Number of triangles

JavaScript Speed: is JS slow? JS is huge Browser JS engines are getting faster and better Most graphics processing happens on the GPU, so once we get data JS is huge We don't need it all

JS Notes Few native types Only one numerical type: 64 bit floats Numbers Strings Booleans Only one numerical type: 64 bit floats var x = 1; var x = 1.0; // same Two equality operators == and === === does type conversion while == does not

JS Notes Scoping Arrays are objects and inherit methods Different from other languages Can use variables without declaring it first Arrays are objects and inherit methods var a = [1, 2, 3]; a.length // 3 a.push(4) // no length is 4 a.pop(); // 4 Problem for WebGL because it expects C-style arrays

Typed Arrays JS has typed arrays that are like C arrays var a = new Float32Array(3) var b = new Uint8Array(3) Generally, work with standard JS, and convert them right before sending them to the GPU

Computer Graphics What is computer graphics? CG deals with all aspects of creating images with a computer: Hardware Software Applications Where did this image originate? What HW/SW was used?

Preliminary Answer Application: The object is an artist’s rendition of the sun for an animation to be shown in a domed environment (planetarium) Software: Maya for modeling and rendering but Maya is built on top of OpenGL Hardware: PC with graphics card for modeling and rendering 14

Basic Graphics System Output device Input devices Image formed in frame buffer 15

Computer Graphics: 1950-1960 Computer graphics goes back to the earliest days of computing Strip charts Pen plotters Simple displays using A/D converters to go from computer to calligraphic CRT Cost of refresh for CRT too high Computers slow, expensive, unreliable 16

Cathode Ray Tube (CRT) Can be used either as a line-drawing device (calligraphic) or to display contents of frame buffer (raster mode) 17

Shadow Mask CRT 18

Computer Graphics: 1960-1970 Wireframe graphics Sketchpad Draw only lines Sketchpad Display Processors wireframe representation of sun object 19

Sketchpad Ivan Sutherland’s PhD thesis at MIT Recognized the potential of man-machine interaction Loop Display something User moves light pen Computer generates new display Sutherland also created many of the now common algorithms for computer graphics 20

Display Processor Rather than have the host computer try to refresh display use a special purpose computer called a display processor (DPU) Graphics stored in display list (display file) on display processor Host compiles display list and sends to DPU 21

Computer Graphics: 1970-1980 Raster Graphics Beginning of graphics standards IFIPS GKS: European effort Becomes ISO 2D standard Core: North American effort 3D but fails to become ISO standard Workstations and PCs 22

Raster Graphics Image produced as an array (the raster) of picture elements (pixels) in the frame buffer 23

Raster Graphics Allows us to go from lines and wire frame images to filled polygons 24

PCs and Workstations Although we no longer make the distinction between workstations and PCs, historically they evolved from different roots Early workstations characterized by Networked connection: client-server model High-level of interactivity Early PCs included frame buffer as part of user memory Easy to change contents and create images 25

Computer Graphics: 1980-1990 Realism comes to computer graphics smooth shading environment mapping bump mapping 26

Computer Graphics: 1980-1990 Special purpose hardware Silicon Graphics geometry engine VLSI implementation of graphics pipeline Industry-based standards PHIGS RenderMan Networked graphics: X Window System Human-Computer Interface (HCI) 27

Computer Graphics: 1990-2000 OpenGL API Completely computer-generated feature-length movies (Toy Story) are successful New hardware capabilities Texture mapping Blending Accumulation, stencil buffers 28

Computer Graphics: 2000-2010 Photorealism Graphics cards for PCs dominate market Nvidia, ATI Game boxes and game players determine direction of market Computer graphics routine in movie industry: Maya, Lightwave Programmable pipelines New display technologies 29

Computer Graphics 2011- Graphics is now ubiquitous OpenGL ES and WebGL Cell phones Embedded OpenGL ES and WebGL Alternate and Enhanced Reality 3D Movies and TV 30

Image Formation In computer graphics, we form images which are generally two dimensional using a process analogous to how images are formed by physical imaging systems Cameras Microscopes Telescopes Human visual system

Elements of Image Formation Objects Viewer Light source(s) Attributes that govern how light interacts with the materials in the scene Note the independence of the objects, the viewer, and the light source(s)

Light Light is the part of the electromagnetic spectrum that causes a reaction in our visual systems Generally these are wavelengths in the range of about 350-750 nm (nanometers) Long wavelengths appear as reds and short wavelengths as blues

Ray Tracing and Geometric Optics One way to form an image is to follow rays of light from a point source finding which rays enter the lens of the camera. However, each ray of light may have multiple interactions with objects before being absorbed or going to infinity.

Luminance and Color Images Luminance Image Monochromatic Values are gray levels Analogous to working with black and white film or television Color Image Has perceptional attributes of hue, saturation, and lightness Do we have to match every frequency in visible spectrum? No!

Three-Color Theory Human visual system has two types of sensors Rods: monochromatic, night vision Cones Color sensitive Three types of cones Only three values (the tristimulus values) are sent to the brain Need only match these three values Need only three primary colors

Shadow Mask CRT 37 Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

Additive and Subtractive Color Additive color Form a color by adding amounts of three primaries CRTs, projection systems, positive film Primaries are Red (R), Green (G), Blue (B) Subtractive color Form a color by filtering white light with cyan (C), Magenta (M), and Yellow (Y) filters Light-material interactions Printing Negative film

Pinhole Camera Use trigonometry to find projection of point at (x,y,z) xp= -x/z/d yp= -y/z/d zp= d These are equations of simple perspective

Synthetic Camera Model projector p image plane projection of p center of projection

Advantages Separation of objects, viewer, light sources Two-dimensional graphics is a special case of three-dimensional graphics Leads to simple software API Specify objects, lights, camera, attributes Let implementation determine image Leads to fast hardware implementation

Global vs Local Lighting Cannot compute color or shade of each object independently Some objects are blocked from light Light can reflect from object to object Some objects might be translucent

Why not ray tracing? Ray tracing seems more physically based so why don’t we use it to design a graphics system? Possible and is actually simple for simple objects such as polygons and quadrics with simple point sources In principle, can produce global lighting effects such as shadows and multiple reflections but ray tracing is slow and not well-suited for interactive applications Ray tracing with GPUs is close to real time https://www.youtube.com/watch?v=2ow7cbtzg1E