- Introduction - Graphics Pipeline

Slides:



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

Graphics Pipeline.
CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t.
HCI 530 : Seminar (HCI) Damian Schofield.
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
The Graphics Pipeline CS2150 Anthony Jones. Introduction What is this lecture about? – The graphics pipeline as a whole – With examples from the video.
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.
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CSE 381 – Advanced Game Programming Basic 3D Graphics
Advanced Computer Graphics March 06, Grading Programming assignments Paper study and reports (flipped classroom) Final project No written exams.
Week 2 - Wednesday CS361.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
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.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
Homogeneous Form, Introduction to 3-D Graphics Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 20,
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.
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.
1 Computer Graphics Week2 –Creating a Picture. Steps for creating a picture Creating a model Perform necessary transformation Lighting and rendering the.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
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 Perception and VR MONT 104S, Fall 2008 Lecture 20 Computer Graphics and VR.
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.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
Applications and Rendering pipeline
Introduction to Computer Graphics
Computer Graphics Overview
Photorealistic Rendering vs. Interactive 3D Graphics
Week 2 - Friday CS361.
Visual Appearance Chapter 4
CSCE 441 Computer Graphics 3-D Viewing
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.
3D Graphics Rendering PPT By Ricardo Veguilla.
CENG 477 Introduction to Computer Graphics
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Understanding Theory and application of 3D
Real-time Computer Graphics Overview
Models and Architectures
Models and Architectures
CSCE 441: Computer Graphics Hidden Surface Removal
Models and Architectures
Introduction to Computer Graphics with WebGL
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
Introduction to Computer Graphics with WebGL
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
Chapter V Vertex Processing
Lecture 13 Clipping & Scan Conversion
Visibility (hidden surface removal)
Models and Architectures
Models and Architectures
Presentation transcript:

- Introduction - Graphics Pipeline Real-time Rendering - Introduction - Graphics Pipeline

Raster Graphics Lower costs enabled by mass production of Television General representations on addressable matrix: text, images, filled primitives Frame buffer Lots of memory; initially expensive Decouple refresh frequency from application update of display list Interlaced and Non-interlaced Need to convert continuous primitives for discrete raster Scan conversion

Raster Graphics

Frame Buffer

Interactivity and Realism Interactivity is defined as 20-30 frames per second Photo-realism is one touchstone for realism Realism and Interactivity are mutually conflicting goals The complexity of graphics datasets of interest keeps growing Time-faithful (interactivity) Space-faithful (visual realism)

The Graphics Rendering Pipeline

The Graphics Rendering Pipeline The pipeline is the engine that creates images from 3D scenes Three conceptual stages of the pipeline: Application (executed on the CPU) Geometry Rasterizer Application Geometry Rasterizer Image output 3D scene input Tomas Akenine-Mőller © 2002

Rendering Primitives Use graphics hardware for real time… These can render points, lines, triangles. A surface is thus an approximation by a number of such primitives. Tomas Akenine-Mőller © 2002

Rendering a 3D scene First, of all to take a picture, it takes a camera – a virtual one. Decides what should end up in the final image A 3D scene is: Geometry (triangles, lines, points, and more) Light sources Material properties of geometry Textures (images to glue onto the geometry) A triangle consists of 3 vertices A vertex is 3D position, and may include normals and more. Tomas Akenine-Mőller © 2002

Virtual Camera Defined by position, direction vector, up vector, field of view, near and far plane. Create image of geometry inside gray region Used by OpenGL, DirectX, ray tracing, etc point dir near far fov (angle)

Back to the pipeline: The APPLICATION stage Geometry Rasterizer Back to the pipeline: The APPLICATION stage Executed on the CPU Means that the programmer decides what happens here Examples: Collision detection Speed-up techniques Animation Most important task: send rendering primitives (e.g. triangles) to the graphics hardware

Application Geometry Rasterizer The GEOMETRY stage Task: ”geometrical” operations on the input data (e.g. triangles) Allows: Move objects (matrix multiplication) Move the camera (matrix multiplication) Compute lighting at vertices of triangle Project onto screen (3D to 2D) Clipping (avoid triangles outside screen) Map to window

Animate objects and camera Application Geometry Rasterizer Animate objects and camera Can animate in many different ways with 4x4 matrices Example: Before displaying a torus on screen, a matrix that represents a rotation can be applied. The result is that the torus is rotated. Same thing with camera (this is possible since motion is relative)

Application Geometry Rasterizer The RASTERIZER stage Main task: take output from GEOMETRY and turn into visible pixels on screen Also, add textures and various other per-pixel operations And visibility is resolved here: sorts the primitives in the z-direction

Rewind! Let’s take a closer look Application Geometry Rasterizer Rewind! Let’s take a closer look The programmer ”sends” down primtives to be rendered through the pipeline (using API calls) The geometry stage does per-vertex operations The rasterizer stage does per-pixel operations Next, scrutinize geometry and rasterizer

The GEOMETRY stage in more detail Application Geometry Rasterizer The GEOMETRY stage in more detail The model transform Originally, an object is in ”model space” Move, orient, and transform geometrical objects into ”world space” Example, a sphere is defined with origin at (0,0,0) with radius 1 Translate, rotate, scale to make it appear elsewhere Done per vertex with a 4x4 matrix multiplication! The user can apply different matrices over time to animate objects

GEOMETRY The view transform Application Geometry Rasterizer GEOMETRY The view transform You can move the camera in the same manner But apply inverse transform to objects, so that camera looks down negative z-axis z x

GEOMETRY Lighting Compute ”lighting” at vertices Application Geometry Rasterizer GEOMETRY Lighting Compute ”lighting” at vertices Try to mimic how light in nature behaves Hard to uses empirical models, hacks, and some real theory light Geometry blue red green Rasterizer Rasterizer Geometry

GEOMETRY Projection Two major ways to do it Application Geometry Rasterizer GEOMETRY Projection Two major ways to do it Orthogonal (useful in few applications) Perspective (most often used) Mimics how humans perceive the world, i.e., objects’ apparent size decreases with distance

GEOMETRY Projection Also done with a matrix multiplication! Application Geometry Rasterizer GEOMETRY Projection Also done with a matrix multiplication! Pinhole camera (left), analog used in CG (right)

GEOMETRY Clipping and Screen Mapping Application Geometry Rasterizer GEOMETRY Clipping and Screen Mapping Square (cube) after projection Clip primitives to square Screen mapping, scales and translates square so that it ends up in a rendering window These ”screen space coordinates” together with Z (depth) are sent to the rasterizer stage

GEOMETRY Summary camera space world space model space world space Application Geometry Rasterizer GEOMETRY Summary camera space world space model space world space compute lighting projection image space clip map to screen

The RASTERIZER in more detail Application Geometry Rasterizer The RASTERIZER in more detail Scan-conversion Find out which pixels are inside the primitive Texturing Put images on triangles Interpolation over triangle Z-buffering Make sure that what is visible from the camera really is displayed Double buffering And more…

The RASTERIZER Scan conversion Application Geometry Rasterizer The RASTERIZER Scan conversion Triangle vertices from GEOMETRY is input Find pixels inside the triangle Or on a line, or on a point Do per-pixel operations on these pixels: Interpolation Texturing Z-buffering And more…

The RASTERIZER Interpolation Application Geometry Rasterizer The RASTERIZER Interpolation Interpolate colors over the triangle Called Gouraud interpolation blue red green

The RASTERIZER Texturing Application Geometry Rasterizer The RASTERIZER Texturing One application of texturing is to ”glue” images onto geometrical object Uses and other applications More realism Bump mapping Pseudo reflections Store lighting Almost infinitely many uses + =

The RASTERIZER Z-buffering Application Geometry Rasterizer The RASTERIZER Z-buffering The graphics hardware is pretty stupid It ”just” draws triangles However, a triangle that is covered by a more closely located triangle should not be visible Assume two equally large tris at different depths Draw 1 then 2 incorrect Draw 2 then 1 correct Triangle 1 Triangle 2

The RASTERIZER Z-buffering Application Geometry Rasterizer The RASTERIZER Z-buffering Would be nice to avoid sorting… The Z-buffer (aka depth buffer) solves this Idea: Store z (depth) at each pixel When scan-converting a triangle, compute z at each pixel on triangle Compare triangle’s z to Z-buffer z-value If triangle’s z is smaller, then replace Z-buffer and color buffer Else do nothing Can render in any order

The RASTERIZER Double buffering Application Geometry Rasterizer The RASTERIZER Double buffering The monitor displays one image at a time So if we render the next image to screen, then rendered primitives pop up And even worse, we often clear the screen before generating a new image A better solution is ”double buffering”

The RASTERIZER Double buffering Application Geometry Rasterizer The RASTERIZER Double buffering Use two buffers: one front and one back The front buffer is displayed The back buffer is rendered to When new image has been created in back buffer, swap front and back

And, lately… Programmable shading has become a hot topic Vertex shaders Pixel shaders Adds more control and much more possibilities for the programmer Application Geometry Rasterizer HARDWARE Vertex shader program Pixel shader program