CS 480/680 Intro Dr. Frederick C Harris, Jr. Fall 2014.

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS SOFTWARE.
Advertisements

COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
Graphics Pipeline.
 The success of GL lead to OpenGL (1992), a platform-independent API that was  Easy to use  Close enough to the hardware to get excellent performance.
Open Graphics Library (OpenGL)
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Course Overview, Introduction to CG Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 5, 2003.
CS 480/680 Computer Graphics Course Overview Dr. Frederick C Harris, Jr. Fall 2012.
What is ? Open Graphics Library A cross-language, multi-platform API for rendering 2D and 3D computer graphics. The API is used to interact with a Graphics.
CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Real-time Graphical Shader Programming with Cg (HLSL)
INTRO TO COMPUTER GRAPHICS TEXT EDWARD ANGEL: EDITION 5 CS770/870
A Really (too) Short Introduction to OpenGL Peter Rautek.
Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Emeritus of Computer Science University of New Mexico.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
CS 480/680 Computer Graphics Programming with Open GL Part 1: Background Dr. Frederick C Harris, Jr. Fall 2011.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
The Graphics Rendering Pipeline 3D SCENE Collection of 3D primitives IMAGE Array of pixels Primitives: Basic geometric structures (points, lines, triangles,
1 Angel and Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Introduction to Computer Graphics 靜宜大學 資訊工程系 蔡奇偉 副教授
1 Angel and Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Introduction to Computer Graphics Ed Angel Professor Emeritus of Computer.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
Computer Graphics I, Fall 2008 Introduction to Computer Graphics.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 CS4610/7610: Introduction to Computer Graphics.
CS 4363/6353 OPENGL BACKGROUND. WHY IS THIS CLASS SO HARD TO TEACH? (I’LL STOP WHINING SOON) Hardware (GPUs) double in processing power ever 6 months!
به نام خدا تنظیم کننده : فرانه حدادی استاد : مهندس زمانیان تابستان 92.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Graphics CSCI 343, Fall 2015 Lecture 2 Introduction to HTML, JavaScript and WebGL.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 1: Background Ed Angel Professor Emeritus.
Computer Graphics Bing-Yu Chen National Taiwan University.
1 3D API OPENGL ES v1.0 Owned by Silicon Graphics (SGL) Control was then transferred to Khronos Group Introduction.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
GLSL OpenGL Programming and Reference Guides, other sources
OpenGL-ES 3.0 And Beyond Boston Photo credit :Johnson Cameraface OpenGL Basics.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Graphics CSCI 343, Fall 2015 Lecture 3 Introduction to WebGL.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 2: Complete Programs Ed Angel Professor.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Emeritus of Computer Science University of New Mexico.
Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Emeritus of Computer Science University of New Mexico.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
What are Computer Graphics Basically anything that is on you Monitor – This includes the text that you will see Text isn’t Advanced Graphics But…. Understanding.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 4: Color and Attributes Isaac Gang University.
GPU Computing for GIS James Mower Department of Geography and Planning University at Albany.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/XX13 – GLSL Lecture 13: OpenGL Shading Language (GLSL) COMP 175: Computer Graphics April 12, 2016.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Lecture 8: Discussion of papers OpenGL programming Lecturer: Simon Winberg Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
CS 480/680 Computer Graphics Programming with Open GL Part 2: Complete Programs Dr. Frederick C Harris, Jr. Fall 2011.
COMPUTER GRAPHICS CHAPTER 38 CS 482 – Fall 2017 GRAPHICS HARDWARE
ICG Syllabus 1. Introduction 2. Viewing in 3D and Graphics Programming
Introduction to OpenGL
Chapter 6 GPU, Shaders, and Shading Languages
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Programming with OpenGL Part 4: Color and Attributes
Chapter VI OpenGL ES and Shader
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics
Programming with OpenGL Part 1: Background
Programming with OpenGL Part 4: Color and Attributes
Computer Graphics Introduction to Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Introduction to OpenGL
OpenGL Background CS 4722.
OpenGL-Rendering Pipeline
CS 480/680 Fall 2011 Dr. Frederick C Harris, Jr. Computer Graphics
Presentation transcript:

CS 480/680 Intro Dr. Frederick C Harris, Jr. Fall 2014

Outline Evolution of the OpenGL Pipeline A Prototype Application in OpenGL OpenGL Shading Language (GLSL) Vertex Shaders Fragment Shaders Examples

What Is OpenGL? OpenGL is a computer graphics rendering application programming interface, or API (for short) –With it, you can generate high-quality color images by rendering with geometric and image primitives –It forms the basis of many interactive applications that include 3D graphics –By using OpenGL, the graphics part of your application can be operating system independent window system independent

We’ll concentrate on the latest versions of OpenGL They enforce a new way to program with OpenGL –Allows more efficient use of GPU resources Modern OpenGL doesn’t support many of the “classic” ways of doing things, such as –Fixed-function graphics operations, like vertex lighting and transformations All applications must use shaders for their graphics processing –we only introduce a subset of OpenGL’s shader capabilities in this course Course Ground Rules

Evolution of the OpenGL Pipeline

In the Beginning … OpenGL 1.0 was released on July 1 st, 1994 Its pipeline was entirely fixed-function –the only operations available were fixed by the implementation The pipeline evolved –but remained based on fixed-function operation through OpenGL versions 1.1 through 2.0 (Sept. 2004) Primitive Setup and Rasterization Primitive Setup and Rasterization Fragment Coloring and Texturing Blending Vertex Data Pixel Data Vertex Transform and Lighting Texture Store

Beginnings of The Programmable Pipeline OpenGL 2.0 (officially) added programmable shaders –vertex shading augmented the fixed- function transform and lighting stage –fragment shading augmented the fragment coloring stage However, the fixed-function pipeline was still available Primitive Setup and Rasterization Primitive Setup and Rasterization Fragment Coloring and Texturing Blending Vertex Data Pixel Data Vertex Transform and Lighting Texture Store

An Evolutionary Change OpenGL 3.0 introduced the deprecation model –the method used to remove features from OpenGL The pipeline remained the same until OpenGL 3.1 (released March 24 th, 2009) Introduced a change in how OpenGL contexts are used Context TypeDescription Full Includes all features (including those marked deprecated) available in the current version of OpenGL Forward Compatible Includes all non-deprecated features (i.e., creates a context that would be similar to the next version of OpenGL)

The Exclusively Programmable Pipeline OpenGL 3.1 removed the fixed-function pipeline –programs were required to use only shaders Additionally, almost all data is GPU- resident –all vertex data sent using buffer objects Primitive Setup and Rasterization Primitive Setup and Rasterization Fragment Shader Blending Vertex Data Pixel Data Vertex Shader Texture Store

More Programmability OpenGL 3.2 (released August 3 rd, 2009) added an additional shading stage – geometry shaders –modify geometric primitives within the graphics pipeline Primitive Setup and Rasterization Primitive Setup and Rasterization Fragment Shader Blending Vertex Data Pixel Data Vertex Shader Texture Store Geometry Shader

More Evolution: Context Profiles OpenGL 3.2 also introduced context profiles –profiles control which features are exposed it’s like GL_ARB_compatibility, only not insane –currently two types of profiles: core and compatible Context TypeProfileDescription Full coreAll features of the current release compatibleAll features ever in OpenGL Forward Compatible coreAll non-deprecated features compatibleNot supported

The Latest Pipelines OpenGL 4.1 (released July 25 th, 2010) included additional shading stages – tessellation-control and tessellation- evaluation shaders Latest version is 4.5 Primitive Setup and Rasterization Primitive Setup and Rasterization Fragment Shader Blending Vertex Data Pixel Data Vertex Shader Texture Store Geometry Shader Tessellation Control Shader Tessellation Evaluation Shader

OpenGL ES and WebGL OpenGL ES 2.0 –Designed for embedded and hand-held devices such as cell phones –Based on OpenGL 3.1 –Shader based WebGL –JavaScript implementation of ES 2.0 –Runs on most recent browsers

OpenGL Application Development

A Simplified Pipeline Model Vertex Processing Rasterizer Fragment Processing Vertex Shader Vertex Shader Fragment Shader Fragment Shader GPU Data Flow ApplicationFramebuffer Vertices Fragments Pixels

OpenGL Programming in a Nutshell Modern OpenGL programs essentially do the following steps: –Create shader programs –Create buffer objects and load data into them –“Connect” data locations with shader variables –Render

Application Framework Requirements OpenGL applications need a place to render into –usually an on-screen window Need to communicate with native windowing system Each windowing system interface is different We use GLUT (more specifically, freeglut) –simple, open-source library that works everywhere –handles all windowing operations: opening windows input processing

Simplifying Working with OpenGL Operating systems deal with library functions differently –compiler linkage and runtime libraries may expose different functions Additionally, OpenGL has many versions and profiles which expose different sets of functions –managing function access is cumbersome, and window-system dependent We use another open-source library, GLEW, to hide those details

Representing Geometric Objects Geometric objects are represented using vertices A vertex is a collection of generic attributes –positional coordinates –colors –texture coordinates –any other data associated with that point in space Position stored in 4 dimensional homogeneous coordinates Vertex data must be stored in vertex buffer objects (VBOs) VBOs must be stored in vertex array objects (VAOs)

OpenGL’s Geometric Primitives All primitives are specified by vertices GL_TRIANGLE_STRIP GL_TRIANGLE_FAN GL_LINES GL_LINE_LOOP GL_LINE_STRIP GL_TRIANGLES GL_POINTS

A First Program