CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.

Slides:



Advertisements
Similar presentations
Real-Time Rendering 靜宜大學資工研究所 蔡奇偉副教授 2010©.
Advertisements

COMPUTER GRAPHICS SOFTWARE.
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.
RealityEngine Graphics Kurt Akeley Silicon Graphics Computer Systems.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
In the name of God Computer Graphics Bastanfard.
HCI 530 : Seminar (HCI) Damian Schofield.
CS 4731: Computer Graphics Lecture 18: Hidden Surface Removal Emmanuel Agu.
Computer Graphics Hardware Acceleration for Embedded Level Systems Brian Murray
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
Game Engine Design ITCS 4010/5010 Spring 2006 Kalpathi Subramanian Department of Computer Science UNC Charlotte.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
COMP 175: Computer Graphics March 24, 2015
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
CSE 381 – Advanced Game Programming Basic 3D Graphics
Geometric Objects and Transformations. Coordinate systems rial.html.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Week 2 - Wednesday CS361.
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
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.
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.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
1 The Rendering Pipeline. CS788 Topic of HCI 2 Outline  Introduction  The Graphics Rendering Pipeline  Three functional stages  Example  Bottleneck.
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
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.
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.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
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.
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
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.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
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.
- Introduction - Graphics Pipeline
Week 2 - Friday CS361.
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Graphics Processing Unit
Deferred Lighting.
Chapter 6 GPU, Shaders, and Shading Languages
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Models and Architectures
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Graphics Processing Unit
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
Chapter V Vertex Processing
Lecture 13 Clipping & Scan Conversion
Models and Architectures
Models and Architectures
OpenGL-Rendering Pipeline
Presentation transcript:

CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE

DEFINITIONS Graphics Rendering Pipeline Generates (or renders) a 2D image given a 3D scene AKA the “pipeline” A 3D scene contains: A virtual camera 3D Objects Light sources Textures/Materials Etc. GPU = graphics processing unit (i.e., your graphics card) We’ve got this… …and we want this

PIPELINE STAGES The Graphics Rendering Pipeline can be divided into 3 broad stages: Application Completely controlled by programmer Runs on CPU Must send geometry to next stage Geometry – rendering primitives, like points, lines, triangles, polygons, etc. Geometry Performs majority of per-polygon and per-vertex operations (like transformations, projections, etc.) Typically runs on GPU (used to run on CPU) Must send transformed and projected vertices to next stage Also sends other per-vertex information, like color and normals Rasterizer Renders final image and performs per-pixel computations (if desired) Runs on GPU Each of these stages can also be pipelines themselves

PIPELINE SPEEDS Like any pipeline, only runs as fast as slowest stage Slowest stage (bottleneck)  determines rendering speed Rendering speed usually expressed in: Frames per second (fps) Hertz (1/seconds) Rendering speed  called throughput in other pipeline contexts

DEFINING 3D OBJECTS Vertex = point Most basic geometric primitives: Points (1 vertex) Lines(2 vertices) Triangles(3 vertices) MOST of the time, an object/model is defined as a triangle mesh

DEFINING 3D OBJECTS Why triangles? Simple Fits in single plane Can define any polygon in terms of triangles At minimum, a triangle mesh includes: Vertex positions (x,y,z) Face definitions (for each triangle, list of vertex indices)

DEFINING 3D OBJECTS Other geometric primitives: Polygons Circles, ellipses, and other curves Splines Sphere 3D “primitives”: Cube Sphere Torus Cylinder Cone Utah or Newell teapot

RIGHT-HAND RULE OpenGL (and other systems) use the right-hand rule Point right hand toward X, with palm up towards Y  thumb points toward Z

GEOMETRY STAGE Model and View Transform Model coordinates (relative to model)  MODEL TRANSFORM  World coordinates Instance = copy of original model with its own model transform World coordinates  VIEW TRANSFORM  Camera (Eye) Coordinates Virtual camera now starts at (0,0,0) looking down NEGATIVE Z axis X = right, Y = up Vertex Shading = shading calculations using vertex information; programmable Shading – determining the effect of a light (or lights) on a material

GEOMETRY STAGE Projection = transforms view volume into a unit cube  (-1,-1,-1) to (1,1,1) in OpenGL View volume – area inside camera’s view that contains the objects we must render World Coordinates  PROJECTION  normalized device coordinates (x,y,z) Simplifies clipping later Two most common projections: Orthographic (or parallel) View volume = rectangular box Parallel lines remain parallel Perspective View volume = truncated pyramid with rectangular base  called view frustum Things look smaller when farther away

GEOMETRY STAGE Clipping Completely inside  draw Completely outside  don’t draw Partially inside  clip against view volume and only draw part inside view volume  adds new vertices Screen Mapping = map to display window (x,y) of normalized device coordinates  SCREEN MAPPING  (x’, y’) screen coordinates (also device coordinates) z coordinates unchanged (x’,y’,z) = window coordinates = screen coordinates + z Window coordinates passed to rasterizer stage Origin = lower-left corner in OpenGL Center of pixel (0,0) = (0.5, 0.5) in OpenGL

RASTERIZER STAGE Primary goal  rasterization (or scan conversion) Computing and setting colors for pixels covered by the objects Convert 2D vertices + z value + shading info  pixels on screen Has four basic stages: Triangle setup Triangle traversal Finds which samples/pixels are inside each triangle Generates a fragment for each part of a pixel covered by a triangle Fragment properties  interpolated from triangle vertices Pixel shading = per-pixel shading calculations Outputs one or more colors per pixel (one for each fragment) Programmable Merging = combine each fragment color with color current stored in color buffer Color buffer  stores color for each pixel Uses Z-buffer to determine fragment visibility

FRAGMENT DEFINITION Fragment = data necessary to shade/color a pixel due to a primitive covering or partially covering that pixel Data can include color, depth, texture coordinates, normal, etc. Values are interpolated from primitive’s vertices Can have multiple fragments per pixel Final pixel color will either be one of the fragments (i.e., z-buffer chooses nearest one) or combination of fragments (e.g., alpha blending)

RASTERIZER STAGE: MERGING AND Z- BUFFER Z-buffer algorithm Check z value of incoming fragment If closer to camera than previous value in Z-buffer  override color in color buffer and update z value Advantages: O(n)  n = number of primitives Simple Can draw OPAQUE objects in any order Disadvantages: Transparent objects more complicated

RASTERIZER STAGE: MERGING AND BUFFERS Frame buffer Means all buffers on system (but sometimes just refers to color + Z-buffer) To prevent the user from seeing the buffer while it’s being updated  use double-buffering Two buffers, one visible and one invisible Draw on invisible buffer  swap buffers

FIXED-FUNCTION VS. PROGRAMMABLE Fixed-function pipeline stages Elements are set up in hardware a specify way Usually can only turn things on or off or change options (defined by hardware and graphics API) Programmable pipeline stages Vertex shading and pixel (fragment) shading Have direct control over what is done at given stage

DEFINITIONS Computer-graphics application programming interfaces (CG API) Common CG APIs: GL, OpenGL, DirectX, VRML, Java 2D, Java 3D, etc. Interface between programming language and hardware

GL AND OPENGL GL (Graphics Library) Developed by Silicon Graphics, Inc. (SGI) for their graphics workstations Became de facto graphics standard Fast, real-time rendering Proprietary system OpenGL Developed as hardware-independent version of GL in 1990’s Specification Now maintained by Khronos Group Designed for efficient 3D rendering, but also handles 2D (just set z = 0) Stable; new features added as extensions SGI O2 workstation: