CS 418: Interactive Computer Graphics. Introduction. Eric Shaffer

Similar documents
Image Formation. CS418 Computer Graphics Eric Shaffer.

CIS 581 Interactive Computer Graphics

CIS 581 Interactive Computer Graphics (slides based on Dr. Han-Wei Shen s slides) Requirements. Reference Books. Textbook

0. Introduction: What is Computer Graphics? 1. Basics of scan conversion (line drawing) 2. Representing 2D curves

Computer Graphics Fundamentals. Jon Macey

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Lecture 1. Computer Graphics and Systems. Tuesday, January 15, 13

EF432. Introduction to spagetti and meatballs

Topic 0. Introduction: What Is Computer Graphics? CSC 418/2504: Computer Graphics EF432. Today s Topics. What is Computer Graphics?

EF432. Introduction to spagetti and meatballs

Some Resources. What won t I learn? What will I learn? Topics

Scalable Vector Graphics (SVG) vector image World Wide Web Consortium (W3C) defined with XML searched indexed scripted compressed Mozilla Firefox

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

Computer Graphics CS 543 Lecture 1 (Part I) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

CS450/550. Pipeline Architecture. Adapted From: Angel and Shreiner: Interactive Computer Graphics6E Addison-Wesley 2012

CS452/552; EE465/505. Clipping & Scan Conversion

Computer Graphics (CS 543) Lecture 1 (Part 1): Introduction to Computer Graphics

Computer Graphics. Instructor: Oren Kapah. Office Hours: T.B.A.

CS 4620 Program 3: Pipeline

Lecture 6 of 41. Scan Conversion 1 of 2: Midpoint Algorithm for Lines and Ellipses

Lecture 6 of 41. Scan Conversion 1 of 2: Midpoint Algorithm for Lines and Ellipses

Models and Architectures

CS354 Computer Graphics Introduction. Qixing Huang Januray 17 8h 2017

National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor

Lecture 0 of 41: Part A Course Organization. Introduction to Computer Graphics: Course Organization and Survey

Introduction to Computer Graphics with WebGL

Lahore University of Management Sciences. CS 452 Computer Graphics

3D graphics, raster and colors CS312 Fall 2010

Assignment 1 due 4/13/2017 at 11:59PM Topic: Getting Started with WebGL and Transformations

Manipal Institute of Technology Manipal University Manipal

3D GRAPHICS. design. animate. render

CS 543: Computer Graphics. Introduction

CS451Real-time Rendering Pipeline

CS 354R: Computer Game Technology

Lecturer Athanasios Nikolaidis

Scalable Vector Graphics commonly known as SVG is a XML based format to draw vector images. It is used to draw twodimentional vector images.

Introduction to 2D Graphics

Computer Graphics and Visualization. What is computer graphics?

CSE4030 Introduction to Computer Graphics

Computer Graphics Introduction. Taku Komura

Computer Graphics Lecture 2

CS130 : Computer Graphics Lecture 2: Graphics Pipeline. Tamar Shinar Computer Science & Engineering UC Riverside

Introduction to Computer Graphics. Knowledge basic concepts 2D and 3D computer graphics

The Graphics Pipeline and OpenGL I: Transformations!

Animation & Rendering

CS474 MULTIMEDIA TECHNOLOGY

INFOGR Computer Graphics

ENGINEERING Electrical Engineering

CS5620 Intro to Computer Graphics

Welcome to CS 4/57101 Computer Graphics

PROFESSIONAL. WebGL Programming DEVELOPING 3D GRAPHICS FOR THE WEB. Andreas Anyuru WILEY. John Wiley & Sons, Ltd.

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Outline. Intro. Week 1, Fri Jan 4. What is CG used for? What is Computer Graphics? University of British Columbia CPSC 314 Computer Graphics Jan 2013

Intro. Week 1, Fri Jan 4

Hidden surface removal. Computer Graphics

3D Programming. 3D Programming Concepts. Outline. 3D Concepts. 3D Concepts -- Coordinate Systems. 3D Concepts Displaying 3D Models

CS380: Computer Graphics Introduction. Sung-Eui Yoon ( 윤성의 ) Course URL:

TEACHING PLAN FAKULTI TEKNOLOGI MAKLUMAT DAN KOMUNIKASI UNIVERSITI TEKNIKAL MALAYSIA MELAKA

CSCE 441 Computer Graphics Fall 2018

We assume that you are familiar with the following:

API Background. Prof. George Wolberg Dept. of Computer Science City College of New York

Computer Graphics and Visualization. Graphics Systems and Models

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Visual HTML5. Human Information Interaction for Knowledge Extraction, Interaction, Utilization, Decision making HI-I-KEIUD

The Rendering Pipeline

Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University

Curves & Splines. Assignment #3. Overview & Objectives. Due Dates. CPSC 453 Fall 2018 University of Calgary

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

COMP Preliminaries Jan. 6, 2015

CS559 Computer Graphics Fall 2015

The Graphics Pipeline and OpenGL I: Transformations!

WebGL and GLSL Basics. CS559 Fall 2015 Lecture 10 October 6, 2015

We will use WebGL 1.0. WebGL 2.0 is now being supported by most browsers but requires a better GPU so may not run on older computers or on most cell

CSCD18: Computer Graphics. Instructor: Leonid Sigal

Data Visualization (DSC 530/CIS )

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Computer Science 175. Introduction to Computer Graphics lib175 time: m/w 2:30-4:00 pm place:md g125 section times: tba

1 Preview. Dr. Scott Gordon Computer Science Dept. CSUS. Virtual Cameras, Viewing Transformations: CSc-155 Advanced Computer Graphics

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

CSE 167: Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

COS 116 The Computational Universe Laboratory 10: Computer Graphics

Midterm Exam CS 184: Foundations of Computer Graphics page 1 of 11

OpenGL shaders and programming models that provide object persistence

Graphics for VEs. Ruth Aylett

OUTLINE. Learn the basic design of a graphics system Introduce pipeline architecture Examine software components for a graphics system

Programming Project 1

Lahore University of Management Sciences. CS 452 Computer Graphics

I expect to interact in class with the students, so I expect students to be engaged. (no laptops, smartphones,...) (fig)

Pipeline Operations. CS 4620 Lecture 10

CISC 110 Week 1. An Introduction to Computer Graphics and Scripting

LOD and Occlusion Christian Miller CS Fall 2011

CSC 8470 Computer Graphics. What is Computer Graphics?

Shadows in the graphics pipeline

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

03 Vector Graphics. Multimedia Systems. 2D and 3D Graphics, Transformations

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Transcription:

CS 418: Interactive Computer Graphics Introduction Eric Shaffer

Computer Graphics is Used By Video Game Industry Revenue of $99B globally in 2016

Computer Graphics is Used By Medical Imaging and Scientific Visualization Imaging one of the biggest advances in medicine Sci Vis allows people to see previously hidden phenomena

Computer Graphics is Used By Computer Aided Design Engineering, Architecture, the Maker movement

Computer Graphics is Used By Movie Industry Production rendering non-interactive (CS 419)

Although Real-Time is Getting Closer to Production Quality Why would this be useful when making a movie? Why is the speedup in producing the scene greater than just the speedup of realtime over production?

CS 418 Interactive Computer Graphics Focus on algorithms and techniques used in rasterization Rasterization is fast enough for real-time complex 3D rendering The course will teach you how to use WebGL Web-based rasterization engine Similar features to many other technologies (e.g. OpenGL, Vulkan, D3D) We will also cover fundamental graphics algorithms Things like line drawing that reside inside the WebGL library

Things you would not use WebGL for.. Making a Game Typically would use a game engine like Unity or Unreal Making a Movie Renderman 3D web app development three.js which is built on WebGL But to use three.js you need to understand WebGL And, basic CG concepts need to be understood to use Unity or Renderman as well

Class Mechanics Course Website: https://courses.engr.illinois.edu/cs418/index.html Schedule, lecture materials, assignments Piazza: This term we will be using Piazza for class discussions https://piazza.com/illinois/spring2017/cs418/home. Grades available on Compass NOTE: No recitation sections this week (8/30)

Class Mechanics: Grades Machine Problem 1 15% Machine Problem 2 15% Machine Problem 3 15% Machine Problem 4 10% Exam 1 15% Exam 2 15% Exam 3 15% No Final Exam

Grading Scale Grades probably on usual scale: 97 to 93: A 93 to 90: A- 90 to 87: B+ 87 to 83: B 83 to 80: B- etc. I may adjust the intervals down but not up Extra Credit: Show up for class. I ll take attendance in some manner 3 times randomly Each of those 3 classes is worth 0.5% of the total course grade Online students will receive an equivalent opportunity

Course Policies MPs submitted after the due date lose 10% per day Discussing code is fine, copying code is not If we discover plagiarized code, that code will receive a grade of 0 Do not use 3 rd party code or copy and paste code you find randomly on the web Just to be clear: Type the code yourself. If you are using existing code as reference, change it up when you type it (e.g. change the kind of loop used, what colors are used, etc.) In exceptional circumstances where extension may be reasonable (illness, family emergency etc.) arrangement must be made with the instructor (e-mail: shaffer1@illinois.edu) Exams are in the Computer-Based Testing Facility (CBTF) Post technical questions to Piazza Do not post your code visible to other students (why?) Do not expect us to debug your code (we will try to help.)

Programming Language HTML JavaScript WebGL WebGL version of the GLSL shading language Chrome as default browser Chrome DevTools to debug code If you have a laptop, bring it to recitation section Some WebGL examples: https://www.chromeexperiments.com/webgl

A word about OpenGL Open standard for graphics programming Developed by Silicon Graphics in 1992 Available on most platforms Bindings available for lots of languages It s low level Windowing typically requires another library e.g. GLUT Version 3.0 (2008) introduced programmable shaders Deprecated fixed-function pipeline Vulkan API is the successor technology (still pretty new 2016ish)

WebGL is not exactly OpenGL Figure from WebGL Programming Guide: Interactive 3D Graphics Programming with WebGL by Matsuda and Lea

WebGL Application Structure Figure from WebGL Programming Guide: Interactive 3D Graphics Programming with WebGL by Matsuda and Lea Your application will generally just have HTML and JavaScript files

WebGL WebGL relatively new (2011) 3D graphics support for web WebGL advantages runs in browser naturally cross-platform don t need to obtain/build other libraries gives you windowing for free easy to publish/share your stuff Disadvantages Depends on how you feel about JavaScript Performance can be tricky

Class Mechanics: No Book We ll post notes online It will save you $150 Language References and Resources JavaScript/HTML/CSS: https://developer.mozilla.org/en-us/docs/web/javascript WebGL Specification: https://www.khronos.org/webgl/ WebGL Tutorial: http://webglfundamentals.org/ Suggested Editors: Brackets, LightTable Chrome DevTools Overview: https://developer.chrome.com/devtools

Suggested Books Interactive Computer Graphics: A Top-Down Approach with WebGL (7th Edition) Mar 10, 2014 by Edward Angel and Dave Shreiner

Suggested Books WebGL Programming Guide: Interactive 3D Graphics Programming with WebGL (OpenGL)Jul 19, 2013 by Kouichi Matsuda and Rodger Lea

Suggested Books Professional WebGL Programming: Developing 3D Graphics for the Web May 8, 2012 by Andreas Anyuru

Course Topics Real-time generation of 3D computer graphics through rasterization Low-level basic algorithms Line-drawing Hidden surface removal Lighting and shading Texturing Scan conversion Using these capabilities in WebGL Modeling and viewing transformations Geometric modeling Animation

Super Fast 2D Graphics Overview: Vector Graphics and Raster Graphics Images are made of shapes and colors. Two popular ways of encoding those shapes and colors Vector Graphics Raster Graphics Use an geometric/algebraic description of shape PostScript, PDF, SVG Low memory (display list) Easy to specify a line Adapts to any display resolution Explicitly specifies colors of a set of pixels GIF, JPG, etc. High memory (frame buffer) Hard to draw line Fixed resolution

Definitions: Pixel and Raster A pixel is the smallest controllable picture element in an image A raster is a grid of pixel values Typically rectangular grid of color values (255,0,0), (0,0,255) (0,0,255), (255,0,0)

Rasterization Primitives Pixels Vertices Fills Generate a raster image from a vector description Aliasing 25

2D Example SVG: Canvas Coordinates Mathematical plotting coordinates (-1,1) (1,1) Used to define positions of vertices for graphics primitives (e.g. triangles) Note: Different technologies may use terminology other than canvas coordinates to refer to the same idea (-1,-1) (1,-1)

Canvas Coordinates Can redefine corners of canvas coordinates to whatever is convenient (-0.125,1.125) 1 y = x 2 (1.125,1.125) Can use graph s coordinates for domain and range, but leave room for axes and notation y 0 0 x 1 (-0.125,-0.125) (1.125,-0.125)

Hierarchical Coordinate Systems Create a canvas for entire visualization Extends across area of screen (0,1) 1 (0,1) y = x 2 (1,1) (1,1) Plots coords from (0,0) to (1,1) Create a sub-canvas for plotting data y Extends from (1/8,1/8) to (7/8,7/8) of parent canvas Plots coords from (0,0) to (1,1) 0 (0,0) (1,0) 0 x 1 (0,0) (1,0) 28

Screen Coordinates Physical per-pixel integer coordinates (0,VRES-1) (HRES-1, VRES-1) Sometimes (0,0) is in the upper left corner (e.g. for mouse input) (0,0) (HRES-1,0)

Canvas Screen Transformation Draw primitives in canvas coordinates Extending horizontally from l to r Extending vertically from b to t (l,t) (r,t) Primitives are transformed to screen s pixel coordinates (l,b) (r,b) Rasterization fills in transformed outline with pixel Positions Colors (x,y+h-1) (x+w-1,y+h-1) (x,y) (x+w-1,y)

Working in Screen Coordinates (l=x,t=y+h-1) (r=x+w-1, t=y+h-1) Can use the same coordinates for both canvas and screen coordinates Specify primitives using pixel locations Can result in non-scalable resolution dependent output (l=x,b=y) (x,y+h-1) (r=x+w-1,b=y) (x+w-1,y+h-1) (x,y) (x+w-1,y)

Scalable Vector Graphics (0,0) viewbox = 0 0 1 1 (1,0) Format specification for describing 2-D graphics Embedded in HTML with <svg> tag <svg width=pw height=ph viewbox= x y w h > </svg> Creates a display region of pw x ph pixels in screen coordinates Creates a drawing canvas w x h units in canvas coordinates Origin always upper-left corner (0,1) (1,1)

SVG Drawing Vertices Fills

Circle <!DOCTYPE html> <html> <body> <svg height= 500 width=500 viewbox = "0 0 1 1"> <circle cx = "0.5" cy = "0.5" r = "0.25" stroke-width = "0.01" stroke = "black" fill= "blue"/> </svg> </body> </html>

Rectangle <!DOCTYPE html> <html> <body> <svg height= 500 width=500 viewbox = "0 0 1 1"> <rect x = "0.3" y = "0.2" width = "0.4" height = "0.6" stroke-width = "0.01" stroke = "black" fill= "blue"/> </svg> </body> </html>

Filled Closed Path (0,0) (1,0) <svg height=500 width=500 viewbox= 0 0 1 1 > <path d = M 0.2 0.1 L 0.2 0.3 L 0.4 0.3 L 0.4 0.7 L 0.2 0.7 L 0.2 0.9 L 0.8 0.9 L 0.8 0.7 L 0.6 0.7 L 0.6 0.3 L 0.8 0.3 L 0.8 0.1 Z fill = orange /> </svg> (0,1) (1,1)

3D Graphics: Image Formation Typically, goal in CG is to generate a 2D image of a 3D scene The input data is a scene description Output is an image One approach is to computationally mimic a camera or human eye Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015 In the scene there are objects lights and a viewer 3 7

Sun White Solar Radiation Sky 23% 5% Rayleigh scattering by wavelength Clorophyll Eye Yellow Sunlight Absorption by wavelength Red Cone Response Green Cone Response Green Foliage Blue Cone Response

Synthetic Camera Model

Polygonal Models

Pixel Discretization

Rasterization For each primitive: Compute illumination Project to image plane Fill in pixels

What Should You Know? Class mechanics Difference between Vector Graphics and Raster Graphics

For Next Class If you have a laptop or your own PC Install an editor (e.g. Brackets) Install a browser supporting WebGL (e.g. Chrome) Verify WebGL runs in that browser on your machine https://courses.engr.illinois.edu/cs418/hellocolor.html If you don t have your own computer, try an EWS lab