Review of OpenGL Basics

Slides:



Advertisements
Similar presentations
©Zachary Wartell, UNCC9/28/ :30 AM 1 Overview of OpenGL Revision: 1.2 Copyright Professor Zachary Wartell, University of North Carolina All Rights.
Advertisements

CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
Status – Week 257 Victor Moya. Summary GPU interface. GPU interface. GPU state. GPU state. API/Driver State. API/Driver State. Driver/CPU Proxy. Driver/CPU.
Computer Graphics(Fall 2003) COMS 4160, Lecture 7: OpenGL 3 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
OPENGL Return of the Survival Guide. Buffers (0,0) OpenGL holds the buffers in a coordinate system such that the origin is the lower left corner.
CS 4363/6353 BASIC RENDERING. THE GRAPHICS PIPELINE OVERVIEW Vertex Processing Coordinate transformations Compute color for each vertex Clipping and Primitive.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
Projective Texture Mapping
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
Status – Week 277 Victor Moya.
Status – Week 283 Victor Moya. 3D Graphics Pipeline Akeley & Hanrahan course. Akeley & Hanrahan course. Fixed vs Programmable. Fixed vs Programmable.
The Graphics Pipeline CS2150 Anthony Jones. Introduction What is this lecture about? – The graphics pipeline as a whole – With examples from the video.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
OpenGL (II). How to Draw a 3-D object on Screen?
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
19/4/ :32 Graphics II Syllabus Selection and Picking Session 1.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
 Bitmap: A bitmap is a rectangular array of 0s and 1s that serves as a drawing mask for a corresponding rectangular portion of the window.  Applications:
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
3D API By Clayton Azzopardi (Group 10). Introduction Android uses the OpenGL ES 1.0 API Android uses the OpenGL ES 1.0 API Open Graphics Library for Embedded.
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
Korea University Korea University Computer Graphics Laboratory Computer Graphics Laboratory Jung Lee, Chapter 13.
2002 by Jim X. Chen: 1 So far, we only concerned with the rendering of geometric data. Two other important classes of data:
The Graphics Rendering Pipeline 3D SCENE Collection of 3D primitives IMAGE Array of pixels Primitives: Basic geometric structures (points, lines, triangles,
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
CS 480/680 Intro Dr. Frederick C Harris, Jr. Fall 2014.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
Computing & Information Sciences Kansas State University Lecture 19 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 19 of 42 William H. Hsu.
Computer Graphics Bing-Yu Chen National Taiwan University.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
OpenGL: Introduction Yanci Zhang Game Programming Practice.
1 3D API OPENGL ES v1.0 Owned by Silicon Graphics (SGL) Control was then transferred to Khronos Group Introduction.
OpenGL Architecture Display List Polynomial Evaluator Per Vertex Operations & Primitive Assembly Rasterization Per Fragment Operations Frame Buffer Texture.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
OpenGL-ES 3.0 And Beyond Boston Photo credit :Johnson Cameraface OpenGL Basics.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
09/25/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Shadows Stage 2 outline.
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.
Lecture 7 Midterm Review. OpenGL Libraries gl: Basic OpenGL library, e.g. primitives. glu: OpenGL Utility library, a set of functions to create texture.
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
Introduction to OpenGL (INF 250) Veronika Solteszova et al., UiB Dept. of Informatics,
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
CSC Graphics Programming Budditha Hettige Department of Statistics and Computer Science.
School of Computer Science
Buffers Ed Angel Professor Emeritus of Computer Science
Computer Graphics Lecture 32
Introduction to OpenGL
Chapter 6 GPU, Shaders, and Shading Languages
Models and Architectures
Introduction to Computer Graphics with WebGL
Computer Graphics Buffers
Models and Architectures
Models and Architectures
Buffers Ed Angel Professor Emeritus of Computer Science
Introduction to OpenGL
Presentation transcript:

Review of OpenGL Basics Chap. 1 of Orange Book

Contents OpenGL History Execution model Framebuffer State Processing Pipeline Drawing geometry Drawing images Coordinate transform Texture map

History of OpenGL Revisions Version 1.0 (1992): initial release Version 1.1 (1997): vertex arrays and texture objects. Version 1.2 (1998): 3D textures and an optional set of imaging functionality. Version 1.3 (2001): cube map textures, compressed textures, multitextures, … Version 1.4 (2002): automatic mipmap generation, additional blending functions, internal texture formats for storing depth values for use in shadow computations, support for drawing multiple vertex arrays with a single command, more control over point rasterization, control over stencil wrapping behavior, and various additions to texturing capabilities. Version 1.5 (2003): vertex buffer objects, shadow comparison functions, occlusion queries, and non-power-of-2 textures.

OpenGL 2.0 (Sept.2004) opened up the processing pipeline for user control by providing programmability for both vertex processing and fragment processing OpenGL 2.0 is completely backward compatible with OpenGL 1.5 Other features: multiple render targets (rendering to multiple buffers simultaneously), non-power-of-2 textures, point sprites, and separate stencil functionality for front- and back-facing surfaces.

Execution Model: client-server An application program (the client) issues OpenGL commands that are interpreted and processed by an OpenGL implementation (the server). The application program and the OpenGL implementation can execute on a single computer or on two different computers. Some OpenGL state is stored in the address space of the client, but the majority of it is stored in the address space of the server. OpenGL commands are always processed in the order in which they are received by the server

State Machine OpenGL was designed as a state machine. Cumulatively, the state settings define the behavior of the OpenGL rendering pipeline and the way in which primitives are transformed into pixels on the display device. OpenGL state is collected into a data structure called a graphics context. Window-system-specific functions create and delete graphics contexts. Quite a few server-side state values in OpenGL have just two states: on or off, controlled by glEnable and glDisable. Client-side state values (such as pointers that define vertex arrays) are controlled by glEnableClientState and glDisableClientState. OpenGL maintains a server-side stack for pushing and popping any or all of the defined state values. This stack can be manipulated with glPushAttrib and glPopAttrib. Similarly, client state can be manipulated on a second stack with glPushClientAttrib and glPopClientAttrib. glGet is a generic function that can query many of the components of a graphics context.

Fixed Functionality of OpenGL

Drawing Geometry Sending geometry Per-vertex operations: T&L T&L : transformation and lighting Sending geometry vertex-at-a-time Vertex array Display list new in 1.5: VBO, server-side vertex array Per-vertex operations: T&L vertex positions are transformed by the modelview and projection matrices normals are transformed by the inverse transpose of the upper leftmost 3 x 3 matrix taken from the modelview matrix texture coordinates are transformed by the texture matrices lighting calculations are applied to modify the base color texture coordinates may be automatically generated color material state is applied point sizes are computed [how]

Drawing Geometry Primitive assembly Primitive processing Rasterization vertex data is collected into complete primitives Primitive processing clipping, culling, perspective-divide Rasterization A fragment comprises a window coordinate, depth, and other associated attributes such as color, texture coordinates, and so on. Size,width,stipple, … Fragment processing Texture mapping, fog Per-fragment operations Scissor, depth, stencil, … Framebuffer operations Clear, masking, buffer

Images – (known as)pixel rectangles Pixel unpacking Data of pixel rectangles transferred from memory to OpenGL Pixel transfer glDrawPixels, … glReadPixels; glCopyPixels Rasterize and placement glRasterPos; glPixelZoom Read control glReadBuffer

Coordinate Transformation Light positions are stored within OpenGL as eye coordinate light positions and surface normals must be in the same coordinate system. glLoadIdentity; glMultMatrix; gluLookAt glTranslate; glScale; glRotate glPushMatrix; … glOrtho; gluPerspective; glViewport

Texture Mapping Texture Mapping = Texture access + texture application Texture unit: the underlying piece of graphics hardware that performs the various texturing operations. A texture unit can be enabled for 1D, 2D, 3D, or cube map texturing Texture object: a name and a texture target (1D,2D,3D,cubemap) associated to a texture unit Texture parameters are then assigned (filters, wrap, …) Texture environment and texgen are not stored in texture objects

Texture Mapping Texture environment: Multitexture TexGen the manner in which a texture value is applied to a graphics primitive (replace, modulate, …) Multitexture serially connect texture units glActiveTexture, glMultiTexCoord, … TexGen Procedurally generate texture coordinates

Excursions Vertex array New OpenGL features Reflection models Explanation, spec, example, tutorial, … sought Vertex array What’s the significance of “client-side”? glEnableClientState [how they are used to specify geometry] [vertex array object: server-side vertex array] New OpenGL features Secondary color Compressed texture Reflection models Blinn-Phong: what’s the halfVector in a light? Hemispheric lighting Cook-Torrance, Oren-Nayar, Ward, Ashikhmin-Shirley High dynamic range lighting