Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS SOFTWARE.
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.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
CS-378: Game Technology Lecture #9: More Mapping Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
Informationsteknologi Wednesday, December 12, 2007Computer Graphics - Class 171 Today’s class OpenGL Shading Language.
CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics April 19, 2007.
(conventional Cartesian reference system)
Shading in OpenGL Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
Status – Week 277 Victor Moya.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Introduction to Computer Graphics Ed Angel Professor of Computer Science, Electrical and.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
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.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
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.
Under the Hood: 3D Pipeline. Motherboard & Chipset PCI Express x16.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
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.
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
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.
Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
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
CS662 Computer Graphics Game Technologies Jim X. Chen, Ph.D. Computer Science Department George Mason University.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
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.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
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.
Background image by chromosphere.deviantart.com Fella in following slides by devart.deviantart.com DM2336 Programming hardware shaders Dioselin Gonzalez.
GLSL I.  Fixed vs. Programmable  HW fixed function pipeline ▪ Faster ▪ Limited  New programmable hardware ▪ Many effects become possible. ▪ Global.
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.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Programmable Pipelines
Graphics Processing Unit
Chapter 6 GPU, Shaders, and Shading Languages
Real-time Computer Graphics Overview
Models and Architectures
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Graphics Processing Unit
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics
Models and Architectures
Models and Architectures
Presentation transcript:

Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico

2 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe shaders ­RenderMan

3 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Introduction Recent major advance in real time graphics is programmable pipeline ­First introduced by NVIDIA GForce 3 ­Supported by high-end commodity cards NVIDIA, ATI, 3D Labs ­Software Support Direct X 8, 9, 10 OpenGL Extensions OpenGL Shading Language (GLSL) Cg

4 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Background Two components ­Vertex programs (shaders) ­Fragment programs (shaders) Requires detailed understanding of two seemingly contradictory apporachs ­OpenGL pipeline Real time ­RenderMan ideas offline

5 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Black Box View Geometry Processor Frame Buffer Fragment Processor CPU vertices fragments Rasterizer fragments

6 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Geometric Calculations Geometric data: set of vertices + type ­Can come from program, evaluator, display list ­type: point, line, polygon ­Vertex data can be (x,y,z,w) coordinates of a vertex (glVertex) Normal vector Texture Coordinates RGBA color Other data: color indices, edge flags Additional user-defined data in GLSL

7 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Per-Vertex Operations Vertices transformed by modelview matrix into eye coordinates Normals must be transformed with inverse transpose of modelview matrix so that v·n=v’ ·n’ for shading calculations ­Assumes there is no scaling ­May have to use autonormalization Textures coordinates are generated if autotexture enabled and texture matrix applied

8 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Lighting Calculations Done on a per-vertex basis using modified Phong Model Phong model Problem is the specular term ­Must recompute v and r at every vertex I =kd Id l · n + ks Is (v · r )a + ka Ia

9 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Calculating the Reflection Term angle of incidence = angle of reflection cos  i = cos  r or r·n = l·n r, n, and l are coplanar r =  l +  n normalize 1 = r·r = n·n = l·l solving: r = 2(l · n)n-l

10 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 OpenGL Lighting Modified Phong model ­Halfway vector ­Global ambient term Specified in standard Supported by hardware

11 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Halfway Vector Blinn proposed replacing v·r by n·h where h = (l+v)/|l + v| (l+v)/2 is halfway between l and v If n, l, and v are coplanar:   Must then adjust exponent so that (n·h) e’ ≈ (r.v) e

12 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Primitive Assembly Vertices are next assembled into objects ­Polygons ­Line Segements ­Points Transformation by projection matrix Clipping ­Against user defined planes ­View volume, x=±w, y=±w, z=±w ­Polygon clipping can create new vertices Perspective Division Viewport mapping

13 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Rasterization Geometric entities are rasterized into fragments Each fragment corresponds to a point on an integer grid: a screen pixel Hence each fragment is a potential pixel Each fragment has ­A color ­Possibly a depth value ­Texture coordinates

14 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Fragment Operations Texture generation Fog Antialiasing Scissoring Alpha test Blending Dithering Logical Operation Masking

15 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Vertex Processor Takes in vertices ­Position attribute ­Possibly color ­OpenGL state Produces ­Position in clip coordinates ­Vertex color

16 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Fragment Processor Takes in output of rasterizer (fragments) ­Vertex values have been interpolated over primitive by rasterizer Outputs a fragment ­Color ­Texture Fragments still go through fragment tests ­Hidden-surface removal ­alpha

17 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Programmable Shaders Replace fixed function vertex and fragment processing by programmable processors called shaders Can replace either or both If we use a programmable shader we must do all required functions of the fixed function processor

18 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Development RenderMan Shading Language ­Offline rendering Hardware Shading Languages ­UNC, Stanford ­NVIDIA ­OpenGL Vertex Program Extension ­OpenGL Shading Language ­Cg OpenGL Microsoft HLSL

19 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 RenderMan Developed by Pixar ­S. Upstill, The RenderMan Companion, Addison-Wesley, Model ModelerRenderer interface file (RIB)

20 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Modeling vs Rendering Modeler outputs geometric model plus information for the renderer ­Specifications of camera ­Materials ­Lights May have different kinds of renderers ­Ray tracer ­Radiosity How do we specify a shader?

21 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Shading Trees Shaders such as the Phong model can be written as algebraic expressions But expressions can be described by trees Need now operators such as dot and cross products and new data types such as matrices and vectors Environmental variables are part of state I =k d I d l · n + k s I s (v · r ) s + k a I a

22 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Reflection Vector

23 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Phong Model