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

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

CS 543: Computer Graphics. Introduction

Computer Graphics (CS 4731) OpenGL/GLUT(Part 1)

CS 543 Lecture 1 (Part II): Intro to OpenGL and GLUT (Part I) Emmanuel Agu

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

Computer Graphics (CS 543) Lecture 9 (Part 2): Clipping. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

CS Computer Graphics: Intro to OpenGL

CS Computer Graphics: Intro to OpenGL

Computer Graphics (CS 543) Lecture 1 (Part 2): Introduction to OpenGL/GLUT (Part 1)

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

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

Mathematics in Computer Graphics and Games. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Recall: Indexing into Cube Map

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

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

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

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

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

CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS SPRING 2016 DR. MICHAEL J. REALE

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

Graphics Hardware. Instructor Stephen J. Guy

CS451Real-time Rendering Pipeline

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

CSE4030 Introduction to Computer Graphics

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

3D GRAPHICS. design. animate. render

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

GLUT. What is OpenGL? Introduction to OpenGL and GLUT

COMP Preliminaries Jan. 6, 2015

Computer Graphics (4731) Lecture 4: 2D Graphics Systems (Drawing Polylines, tiling, & Aspect Ratio)

Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics Fundamentals. Jon Macey

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

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

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

CIS 581 Interactive Computer Graphics

Computer Graphics Introduction. Taku Komura

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

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1

Rendering Objects. Need to transform all geometry then

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

Painter s HSR Algorithm

Overview. Computer Graphics CS324. OpenGL. Books. Learning Resources. CS131 Notes. 30 Lectures 3hr Exam

Fog example. Fog is atmospheric effect. Better realism, helps determine distances

CSC 8470 Computer Graphics. What is Computer Graphics?

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

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

Computer Graphics (CS 563) Lecture 4: Advanced Computer Graphics Image Based Effects: Part 2. Prof Emmanuel Agu

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

by Emmanuel Agu Dr. Emmanuel Agu (professor, Emmanuel ) Research areas

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

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

Instructor. Goals. Image Synthesis Examples. Applications. Foundations of Computer Graphics. Why Study 3D Computer Graphics?

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Computer Graphics (CS 4731) OpenGL/GLUT (Part 2)

Computer Graphics. Anders Hast. måndag 25 mars 13

An Overview GLUT GLSL GLEW

Graphics Processing Unit Architecture (GPU Arch)

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.

Lecturer Athanasios Nikolaidis

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CS452/552; EE465/505. Finale!

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

Pipeline Operations. CS 4620 Lecture 14

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

CHAPTER 1 Graphics Systems and Models 3

Ciril Bohak. - INTRODUCTION TO WEBGL

Copyright Khronos Group, Page Graphic Remedy. All Rights Reserved

Spring 2009 Prof. Hyesoon Kim

Computer Graphics Lecture 2

Overview. Computer Graphics CSE 167

Pipeline Operations. CS 4620 Lecture 10

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

Exercise 1 Introduction to OpenGL

Introduction to Computer Graphics with WebGL

MMGD0206 Computer Graphics. Chapter 1 Development of Computer Graphics : History

Programming with OpenGL Part 1: Background

CS4621/5621 Fall Computer Graphics Practicum Intro to OpenGL/GLSL

2.11 Particle Systems

CS 4620 Program 3: Pipeline

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

CS 464 Review. Review of Computer Graphics for Final Exam

CS 418: Interactive Computer Graphics. Introduction. Eric Shaffer

CS 354R: Computer Game Technology

The Graphics Pipeline

The Rendering Pipeline (1)

Early History of APIs. PHIGS and X. SGI and GL. Programming with OpenGL Part 1: Background. Objectives

Introduction to 2D Graphics

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

Computer Graphics (CS 4731) Lecture 18: Lighting, Shading and Materials (Part 3)

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

Chapter 1 Introduction

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL

Spring 2011 Prof. Hyesoon Kim

Models and Architectures

Computer Graphics (CS 4731) Lecture 11: Implementing Transformations. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Transcription:

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

What is Computer Graphics (CG)? Computer graphics: algorithms, mathematics, data structures.. that computer uses to generate PRETTY PICTURES Techniques (e.g. draw a cube, polygon) evolved over years Built into programmable libraries (OpenGL, DirectX, etc) Computer-Generated! Not a picture!

Photorealistic Vs Real-Time Graphics Not this Class This Class Photo-realistic: E.g ray tracing Highest quality image possible slow: may take days to render Real Time graphics: E.g. game engine Milliseconds to render (30 FPS) Lower image quality

Uses of Computer Graphics: Entertainment Entertainment: games Movies Courtesy: Super Mario Galaxy 2 Courtesy: Spiderman

Uses of Computer Graphics Image processing: alter images, remove noise, super-impose images Original Image Sobel Filter

Uses of Computer Graphics Simulators Display math functions E.g matlab Courtesy: Evans and Sutherland

Uses of Computer Graphics Scientific analysis and visualization: Courtesy: Human Brain Project, Denmark

2D Vs. 3D 2-Dimensional (2D) Flat Objects no notion of distance from viewer Only (x,y) color values on screen 3-Dimensional (3D) Objects have distances from viewer (x,y,z) values on screen This class covers both 2D & 3D! Also interaction: Clicking, dragging

About This Course Computer Graphics has many aspects Computer Scientists create/program graphics tools (e.g. Maya, photoshop) Artists use CG tools/packages to create pretty pictures Most hobbyists follow artist path. Not much math! E.g. use blender

About This Course This Course: Computer Graphics for computer scientists!!! Teaches concepts, uses OpenGL as concrete example Course is NOT just about programming OpenGL a comprehensive course in OpenGL. (Only parts of OpenGL covered) about using packages like Maya, Photoshop

About This Course Class is concerned with: How to program computer graphics Underlying mathematics, data structures, algorithms This course is a lot of work. Requires: C/C++, shader programming Lots of math, linear algebra, matrices We will combine: Programmer s view: Program OpenGL APIs Under the hood: Learn OpenGL internals (graphics algorithms, math, implementation)

Course Text Interactive Computer Graphics: A Top-Down Approach with Shader-based OpenGL by Angel and Shreiner (6th edition), 2012 Buy 6 th edition (pure OpenGL). NOT 7 th edition (WebGL)!!! Supplementary books available through the WPI library. How?

Syllabus Summary 3 Exams (50%), 5 Projects (50%) Projects: Develop OpenGL/GLSL code on any platform, must port to Zoolab machine May discuss projects but turn in individual projects Class website: http://web.cs.wpi.edu/~emmanuel/courses/cs543/s18/ Cheating: Immediate F in the course Note: Using past projects on Internet, github, bitbucket is cheating! Advice: Come to class Read the text Understand concepts before coding

Elements of 2D Graphics Polylines Text Filled regions Raster images (pictures)

Elements of 2D Graphics Polyline: vertices (corners) connected by straight lines Attributes: line thickness, color, etc vertex

Text Text attributes: Font, color, size, spacing, and orientation Devices have: text mode graphics mode. Graphics mode: Text is drawn Text mode: Text produced by character generator, not drawn

Filled Regions Filled region: shape filled with a color or pattern E.g: polygons Polygons Filled with Color Polygons Filled with Pattern

Raster Images Raster image (picture): 2D matrix of pixels (picture elements), in different colors or grayscale. Grayscale Image Color Image

Computer Graphics Libraries Functions to draw line, circle, image, etc Previously device-dependent Different OS => different graphics library Tedious! Difficult to port (e.g. move program Windows to Linux) Error Prone Now cross-platform, device-independent libraries APIs: OpenGL, DirectX Working OpenGL program few changes to move from Windows to Linux, etc

Graphics Processing Unit (GPU) OpenGL implemented on GPU chip/hardware => FAST!! Programmable: as shaders GPU located either on PC motherboard (Intel) or Separate graphics card (Nvidia or ATI) GPU on PC motherboard GPU on separate PCI express card

OpenGL Basics OpenGL s function is Rendering (drawing) Rendering? Convert geometric/mathematical object descriptions into images OpenGL can render (draw): 2D and 3D Geometric primitives (lines, dots, etc) Bitmap images (pictures,.bmp,.jpg, etc) OpenGL Program OpenGL

GL Utility Toolkit (GLUT) OpenGL does NOT manage drawing window OpenGL GLUT: Window system independent Concerned only with drawing (2D, 3D, images, etc) No window management (create, resize, etc), very portable Minimal window management Runs on different windowing systems (e.g. Windows, Linux) Program that uses GLUT easily ported between windowing systems. GLUT OpenGL

GL Utility Toolkit (GLUT) No bells and whistles No sliders, dialog boxes, elaborate menus, etc To add bells and whistles, use system s API (or GLUI): X window system Apple: AGL Microsoft :WGL, etc GLUT (minimal) Slider Dialog box

OpenGL Basics: Portability OpenGL programs behave same on different devices, OS Maximal portability Display device independent (Monitor type, etc) OS independent (Unix, Windows, etc) Window system independent based (Windows, X, etc) E.g. If student writes OpenGL code on Apple Mac at home, it runs on Zoolab Windows machines

OpenGL Programming Interface Programmer view of OpenGL Application Programmer Interface (API) Writes OpenGL application programs. E.g gldrawarrays(gl_line_loop, 0, N); glflush( );

Simplified OpenGL Pipeline Vertices input, sequence of rendering steps (vertex processor, clipper, rasterizer, fragment processor) image rendered This class: learn graphics rendering steps, algorithms, their order Vertex Shader Converts 3D to 2D Fragment (Pixel) Shader

Vertex Vs Fragment To draw a shape, OpenGL colors a corresponding group of pixels (fragments) called rasterization E.g yellow triangle converted to group of pixels to be colored yellow Vertex shader code manipulates vertices of shapes Fragment shader code manipulates pixels Vertices Converts shape to pixels (fragments) Fragments (pixels)

OpenGL Program? Usually has 3 files:.cpp file: containing OpenGL code, main( ) function Does initialization, generates/loads geometry to be drawn Vertex shader: manipulates vertices (e.g. move vertices) Fragment shader: manipulates pixels/fragments (e.g change color).cpp program Rendered Image

Framebuffer Dedicated memory location: Draw into framebuffer => shows up on screen Located either on CPU (software) or GPU (hardware)

References Angel and Shreiner, Interactive Computer Graphics (6 th edition), Chapter 1 Hill and Kelley, Computer Graphics using OpenGL (3 rd edition), Chapter 1