Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.

Slides:



Advertisements
Similar presentations
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Advertisements

Graphics Pipeline.
CSC 461: Lecture 51 CSC461 Lecture 5: Simple OpenGL Program Objectives: Discuss a simple program Discuss a simple program Introduce the OpenGL program.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Computer Science,
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 1: Background Ed Angel Professor of Computer Science, Electrical.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
Programming with OpenGL Part 1: Background Mohan Sridharan Based on slides created by Edward Angel CS4395: Computer Graphics 1.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
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.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 46 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 46 Computer Graphics Introduction II.
Basic Graphics Concepts Day One CSCI 440. Terminology object - the thing being modeled image - view of object(s) on the screen frame buffer - memory that.
Chapter 1 Graphics Systems and Models. What is Computer Graphics? Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media.
Graphics System CSC 2141 Introduction to Computer Graphics.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
1 Computer Graphics Week3 –Graphics & Image Processing.
Using OpenGL in Visual C++ Opengl32.dll and glu32.dll should be in the system folder Opengl32.dll and glu32.dll should be in the system folder Opengl32.lib.
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.
Graphics Architectures & OpenGL API Introduction Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Programming with OpenGL Part 1: Background
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
CS 480/680 Computer Graphics Image Formation Dr. Frederick C Harris, Jr.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
CSE Real Time Rendering Week 2. Graphics Processing 2.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
INT 840E Computer graphics Introduction & Graphic’s Architecture.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
Introduction to OpenGL  OpenGL is a graphics API  Software library  Layer between programmer and graphics hardware (and software)  OpenGL can fit in.
Draw a Simple Object. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture blending.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
NoufNaief.net TA: Nouf Al-harbi.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 2: Complete Programs Ed Angel Professor.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
1 Chapter 1: Graphics Systems and Models. 2 Applications of C. G. – 1/4 Display of information Maps GIS (geographic information system) CT (computer tomography)
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 Programming with OpenGL Part 2: Complete Programs.
OpenGL API 2D Graphic Primitives Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 15 Creating 3D Models.
Chapter 1 Graphics Systems and Models Models and Architectures.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
Lecture 1 Computer Graphic. People remember 10% of what they read 20% of what they hear 30% of what they see 50% of what they hear and see 80% of what.
Computer Graphics I, Fall Programming with OpenGL Part 2: Complete Programs.
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Graphics Pipeline Bringing it all together. Implementation The goal of computer graphics is to take the data out of computer memory and put it up on the.
Hank Childs, University of Oregon Oct. 28th, 2016 CIS 441/541: Introduction to Computer Graphics Lecture 16: textures.
Computer Graphics: An Introduction
Draw a Simple Object.
Programming with OpenGL Part 2: Complete Programs
The Graphics Rendering Pipeline
OpenGL API 2D Graphic Primitives
Models and Architectures
Programming with OpenGL Part 2: Complete Programs
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
Models and Architectures
OpenGL program.
Models and Architectures
Programming with OpenGL Part 2: Complete Programs
Programming with OpenGL Part 2: Complete Programs
CS297 Graphics with Java and OpenGL
Programming with OpenGL Part 2: Complete Programs
Presentation transcript:

Graphics Systems and OpenGL

Business of Generating Images Images are made up of pixels

RGB RGB Color cube (what we use in computer graphics) Other color spaces include HSV, YUV, YCrCb, and YIQ

The “goal” of computer graphics Solve the function a pixel is f(i,j)=… a pixel is f(i,j)=… a pixel is f(i,j)=…

Two Dimensional Images Images (at least the ones in this class) are two dimensional shapes. The two axes we will label as X (horizontal), and Y (vertical). X Axis Y Axis (0,0) +X +Y

Hardware Pipeline InputOutputComputation We want to draw a rectangle, how do we describe it to a computer? Model (n) - object description that a computer understands.

Partition the space (7,3) (7,9) (14,3) (14,9) Vertex (pl. Vertices) - a point in 2 or 3 dimensional space. 1. Define a set of points (vertices) in 2D space. 2. Given a set of vertices, draw lines between consecutive vertices.

Record every position Bitmap - a rectangular array of bits mapped one-to-one with pixels.

Representing Objects Most common method is the VERTEX method. Define the object as a set of points with connectivity information. Why is connectivity important? Connectivity - information that defines which vertices are connected to which other vertices via edges. Edge - connects two vertices

A Simple Program Generate a square on a solid background

simple.c #include void mydisplay(){ glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_QUADS); glVertex2f(-0.5, -0.5); glVertex2f(-0.5, 0.5); glVertex2f(0.5, 0.5); glVertex2f(0.5, -0.5); glEnd(); glFlush(); } int main(int argc, char** argv){ glutCreateWindow("simple"); glutDisplayFunc(mydisplay); glutMainLoop(); }

How do we do this?

Practical Approach Process objects one at a time in the order they are generated by the application Pipeline architecture: All steps can be implemented in hardware on the graphics card application program display InputOutputComputation

simple.c #include void mydisplay(){ glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_QUADS); glVertex2f(-0.5, -0.5); glVertex2f(-0.5, 0.5); glVertex2f(0.5, 0.5); glVertex2f(0.5, -0.5); glEnd(); glFlush(); } int main(int argc, char** argv){ glutCreateWindow("simple"); glutDisplayFunc(mydisplay); glutMainLoop(); }

Synthetic Camera Model center of projection image plane projector p projection of p

Vertex Processing Much of the work in the pipeline is in converting object representations from one coordinate system to another –Object coordinates –Camera (eye) coordinates –Screen coordinates Every change of coordinates is equivalent to a matrix transformation Vertex processor also computes vertex colors

Projection Projection is the process that combines the 3D viewer with the 3D objects to produce the 2D image –Perspective projections: all projectors meet at the center of projection –Parallel projection: projectors are parallel, center of projection is replaced by a direction of projection

Primitive Assembly Vertices must be collected into geometric objects before clipping and rasterization can take place –Line segments –Polygons –Curves and surfaces

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 bufffer –Color and depth attributes Vertex attributes are interpolated over objects by the rasterizer

Fragment Processing Fragments are processed to determine the color of the corresponding pixel in the frame buffer 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