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

Similar documents
Programming with OpenGL Part 1: Background

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

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

Introduction to Computer Graphics with WebGL

Models and Architectures

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

Computer Graphics. Bing-Yu Chen National Taiwan University

CIS 441/541: Introduction to Computer Graphics Lecture 14: OpenGL Basics

LECTURE 02 OPENGL API

CSE4030 Introduction to Computer Graphics

Introduction to OpenGL Week 1

Objectives. Image Formation Revisited. Physical Approaches. The Programmer s Interface. Practical Approach. Introduction to OpenGL Week 1

Models and Architectures. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

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

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

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

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

Introduction to OpenGL

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

Lecture 2 CISC440/640 Spring Department of Computer and Information Science

CS 4204 Computer Graphics

Programming with OpenGL Part 1: Background

Lecture 13: OpenGL Shading Language (GLSL)

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

Graphics Pipeline & APIs

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

An Overview GLUT GLSL GLEW

Ciril Bohak. - INTRODUCTION TO WEBGL

Graphics Pipeline & APIs

Computer Graphics - Chapter 1 Graphics Systems and Models

Computer Graphics. Chapter 3 Computer Graphics Software

Programming with WebGL Part 1: Background. CS 432 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Graphics Hardware. Instructor Stephen J. Guy

Rendering Objects. Need to transform all geometry then

CS452/552; EE465/505. Overview of Computer Graphics

OPEN GL BACKGROUND. Objectives. Early History of APIs. SGI and GL. PHIGS and X. Modified from Angel 6e book slides

20 Years of OpenGL. Kurt Akeley. Copyright Khronos Group, Page 1

Grafica Computazionale: Lezione 30. Grafica Computazionale. Hiding complexity... ;) Introduction to OpenGL. lezione30 Introduction to OpenGL

Exercise 1 Introduction to OpenGL

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

Computer Graphics and Visualization. Graphics Systems and Models

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

CS 4620 Program 3: Pipeline

Introduction to Shaders.

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)

3D Graphics and OpenGl. First Steps

VR-programming tools (procedural) More VRML later in this course! (declarative)

OpenGL Essentials Training

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

CGT521 Introduction to

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

Lecture 4 of 41. Lab 1a: OpenGL Basics

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

CS770/870 Spring 2017 Open GL Shader Language GLSL

CS770/870 Spring 2017 Open GL Shader Language GLSL

Computer Graphics Lecture 2

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

CS451Real-time Rendering Pipeline

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

OpenGL. Toolkits.

Pipeline Operations. CS 4620 Lecture 14

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

Next Generation OpenGL Neil Trevett Khronos President NVIDIA VP Mobile Copyright Khronos Group Page 1

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

CS 428: Fall Introduction to. OpenGL primer. Andrew Nealen, Rutgers, /13/2010 1

Lecture 2 5 Aug 2004

CSC 8470 Computer Graphics. What is Computer Graphics?

INTRODUCTION. Slides modified from Angel book 6e

Rasterization Overview

Rendering. Part 1 An introduction to OpenGL

OpenGL Basics I. Seoul National University Graphics & Media Lab

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

CS 381 Computer Graphics, Fall 2012 Midterm Exam Solutions. The Midterm Exam was given in class on Tuesday, October 16, 2012.

Basic Graphics Programming

CS452/552; EE465/505. Image Formation

OpenGL/GLUT Intro. Week 1, Fri Jan 12

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

CS427 Multicore Architecture and Parallel Computing

OpenGL SUPERBIBLE. Fifth Edition. Comprehensive Tutorial and Reference. Richard S. Wright, Jr. Nicholas Haemel Graham Sellers Benjamin Lipchak

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

1.2 Basic Graphics Programming

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

Programming shaders & GPUs Christian Miller CS Fall 2011

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

Objectives. Programming with WebGL Part 1: Background. Retained vs. Immediate Mode Graphics. Early History of APIs. PHIGS and X.

The Graphics Pipeline

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

Copyright Khronos Group 2012 Page 1. Teaching GL. Dave Shreiner Director, Graphics and GPU Computing, ARM 1 December 2012

Three Main Themes of Computer Graphics

CHAPTER 1 Graphics Systems and Models 3

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

11/1/13. Basic Graphics Programming. Teaching Assistant. What is OpenGL. Course Producer. Where is OpenGL used. Graphics library (API)

GLUT. What is OpenGL? Introduction to OpenGL and GLUT

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

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

Introduction to 2D Graphics

Copyright Khronos Group, Page Graphic Remedy. All Rights Reserved

Books, OpenGL, GLUT, GLUI, CUDA, OpenCL, OpenCV, PointClouds, and G3D

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

We assume that you are familiar with the following:

Transcription:

CS450/550 Pipeline Architecture Adapted From: Angel and Shreiner: Interactive Computer Graphics6E Addison-Wesley 2012 0 Objectives Learn the basic components of a graphics system Introduce the OpenGL pipeline architecture Introduce the structure of OpenGL Libraries 1 1

Image Formation Revisited Can we mimic the synthetic camera model to design graphics hardware software? Application Programmer Interface (API) Need only specify Objects Materials Viewer Lights But how is the API implemented? Physical Approaches Ray tracing: follow rays of light from center of projection until they either are absorbed by objects or go off to infinity Can handle global effects Multiple reflections Translucent objects Slow Must have entire DB available Photon Mapping: Similar approach to deposit light in the scene 2

Practical Approach: Pipeline Architecture Process objects one at a time in the order they are generated by the application Can consider only local lighting All steps can be implemented in hardware on the graphics card Vertex Processing Much of the work in the pipeline is in converting object representations from one coordinate system to another Object coordinates World Coordinates Camera (eye) coordinates Screen coordinates Vertex processor also computes vertex colors 3

Projection (3D to 2D) & Clipping Just as a real camera cannot see the whole world, the virtual camera can only see part of the world or object space Objects that are not within this volume are said to be clipped out of the scene Rasterization If an object is not clipped out, the appropriate pixels in the frame buffer must be assigned colors Rasterizer produces a set of fragments for each object Fragments are potential pixels Have a location in frame buffer Color and depth attributes Vertex attributes are interpolated over objects by the rasterizer 7 4

Fragment Processing Fragments are processed to determine the color of the corresponding pixel in the framebuffer Colors can be determined by texture mapping or interpolation of vertex colors Fragments may be blocked by other fragments closer to the camera Hidden-surface removal 8 Full Pipeline Diagram 9 5

The Programmers Interface to the Pipeline: API Programmer sees the graphics system through a software interface: the Application Programmer Interface (API) client! server! 1 0 Example (old style) Immediate Mode type of object location of vertex glbegin(gl_polygon) glvertex3f(0.0, 0.0, 0.0); glvertex3f(0.0, 1.0, 0.0); glvertex3f(0.0, 0.0, 1.0); glend( ); end of object definition 1 1 6

Retained Mode Graphics for some number of points generate a point store it in a data structure on client display_all_points() /* One call */ /* still sends all pts*/ 12 Modern GPU Approach for some number of points generate a point store it in a data structure on client send_all_points_to_gpu() display_all_points_on_gpu( AS_TRIANGLES) /* One call to draw them */ /* Tell server how to interpret the data */ 7

Modern OpenGL API Performance is achieved by using GPU rather than CPU Control GPU through programs called shaders Applications job is to send data to GPU GPU does all rendering programmable! E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 API History: SGI and GL Silicon Graphics (SGI) revolutionized the graphics workstation by implementing the pipeline in hardware (1982) To access the system, application programmers used a library called GL With GL, it was relatively simple to program three dimensional interactive applications E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 8

OpenGL The success of GL lead to OpenGL (1992), a platformindependent API that was Easy to use Close enough to the hardware to get excellent performance Focus on rendering Omitted windowing and input to avoid window system dependencies E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 OpenGL Evolution Originally controlled by an Architectural Review Board (ARB) Members included SGI, Microsoft, Nvidia, HP, 3DLabs, IBM, Now Khronos Group (www.khronos.org/opengl) Was relatively stable (through version 2.5) Backward compatible Evolution reflects new hardware capabilities Allows platform specific features through extensions 9

OpenGL 3.1 Totally shader-based No default shaders Each application must provide both a vertex and a fragment shader No immediate mode Few state variables Most 2.5 functions deprecated Backward compatibility not required We ll use version 3.2 for this class E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 OpenGL Versions OpenGL ES Embedded systems Version 1.0 simplified OpenGL 2.1 Version 2.0 simplified OpenGL 3.1 Shader based WebGL Javascript implementation of ES 2.0 Supported on newer browsers OpenGL 4.1 and 4.2 (up to 4.5 Now) Add geometry shaders and tessellator E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 10

OpenGL Libraries OpenGL core library OpenGL32 on Windows (opengl32.lib) GL on most unix/linux systems OpenGL Framework on Mac OpenGL Utility Library (GLU) (glu32.lib) Provides functionality in OpenGL core but avoids having to rewrite code (ie. spheres) Links with window system GLX for X window systems WGL for Windows (windows.h) AGL for Macintosh Platform Independent Options (glut, fltk, etc.) Angel: Interactive Computer Graphics 3E Addison-Wesley 2002 GLUT OpenGL Utility Library (GLUT) (glut32.lib) Provides functionality common to all window systems Open a window Get input from mouse and keyboard Menus Event-driven Code is portable but GLUT lacks the functionality of a good toolkit for a specific platform Angel: Interactive Computer Graphics 3E Addison-Wesley 2002 11

Software Organization application program OpenGL Motif widget or similar GLX, AGL or WGL X, Win32, Mac O/S GLUT GLU GL software and/or hardware Angel: Interactive Computer Graphics 3E Addison-Wesley 2002 2 2 12