The Traditional Graphics Pipeline

Similar documents
Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

INTRODUCTION TO RENDERING TECHNIQUES

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007

Scan-Line Fill. Scan-Line Algorithm. Sort by scan line Fill each span vertex order generated by vertex list

Computer Applications in Textile Engineering. Computer Applications in Textile Engineering

A Short Introduction to Computer Graphics

COMP175: Computer Graphics. Lecture 1 Introduction and Display Technologies

Introduction to Computer Graphics

Lecture Notes, CEng 477

Computer Graphics. Anders Hast

Computer Graphics Hardware An Overview

CUBE-MAP DATA STRUCTURE FOR INTERACTIVE GLOBAL ILLUMINATION COMPUTATION IN DYNAMIC DIFFUSE ENVIRONMENTS

Computer Graphics. Introduction. Computer graphics. What is computer graphics? Yung-Yu Chuang

Recent Advances and Future Trends in Graphics Hardware. Michael Doggett Architect November 23, 2005

B2.53-R3: COMPUTER GRAPHICS. NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions.

Lezione 4: Grafica 3D*(II)

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

Triangle Scan Conversion using 2D Homogeneous Coordinates

3D Math Overview and 3D Graphics Foundations

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Teaching Introductory Computer Graphics Via Ray Tracing

Petrel TIPS&TRICKS from SCM

Computer Graphics CS 543 Lecture 12 (Part 1) Curves. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

2.3 WINDOW-TO-VIEWPORT COORDINATE TRANSFORMATION

CSE 564: Visualization. GPU Programming (First Steps) GPU Generations. Klaus Mueller. Computer Science Department Stony Brook University

G.H. Raisoni College of Engineering, Nagpur. Department of Information Technology

Silverlight for Windows Embedded Graphics and Rendering Pipeline 1

The Evolution of Computer Graphics. SVP, Content & Technology, NVIDIA

Touchstone -A Fresh Approach to Multimedia for the PC

Lecture 3: Models of Spatial Information

Line and Polygon Clipping. Foley & Van Dam, Chapter 3

CS 4204 Computer Graphics

Realtime 3D Computer Graphics Virtual Reality

GPU(Graphics Processing Unit) with a Focus on Nvidia GeForce 6 Series. By: Binesh Tuladhar Clay Smith

Computational Geometry. Lecture 1: Introduction and Convex Hulls

Scan Conversion of Filled Primitives Rectangles Polygons. Many concepts are easy in continuous space - Difficult in discrete space

Making natural looking Volumetric Clouds In Blender 2.48a

Hardware design for ray tracing

REAL-TIME IMAGE BASED LIGHTING FOR OUTDOOR AUGMENTED REALITY UNDER DYNAMICALLY CHANGING ILLUMINATION CONDITIONS

Reflection and Refraction

Computer Graphics. Geometric Modeling. Page 1. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science - Technion. An Example.

Computer Graphics Global Illumination (2): Monte-Carlo Ray Tracing and Photon Mapping. Lecture 15 Taku Komura

Shader Model 3.0. Ashu Rege. NVIDIA Developer Technology Group

We can display an object on a monitor screen in three different computer-model forms: Wireframe model Surface Model Solid model

How To Draw In Autocad

Introduction Week 1, Lecture 1

Shadows. Shadows. Thanks to: Frédo Durand and Seth Teller MIT. Realism Depth cue

Computer Graphics Lecture Notes

Course Overview. CSCI 480 Computer Graphics Lecture 1. Administrative Issues Modeling Animation Rendering OpenGL Programming [Angel Ch.

Modern Graphics Engine Design. Sim Dietrich NVIDIA Corporation

Last lecture... Computer Graphics:

Lecture 15: Hardware Rendering

Comp 410/510. Computer Graphics Spring Introduction to Graphics Systems

GPU Shading and Rendering: Introduction & Graphics Hardware

GPU Architecture. Michael Doggett ATI

Volume visualization I Elvins

Curves and Surfaces. Goals. How do we draw surfaces? How do we specify a surface? How do we approximate a surface?

IT 386: 3D Modeling and Animation. Review Sheet. Notes from Professor Nersesian s IT 386: 3D Modeling and Animation course

Introduction to GIS (Basics, Data, Analysis) & Case Studies. 13 th May Content. What is GIS?

H.Calculating Normal Vectors

Blender 3D: Noob to Pro/Die Another Way

Geometry for Computer Graphics

Image Synthesis. Transparency. computer graphics & visualization

DATA VISUALIZATION OF THE GRAPHICS PIPELINE: TRACKING STATE WITH THE STATEVIEWER

Advanced Visual Effects with Direct3D

CSE 167: Lecture 13: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Activity Set 4. Trainer Guide

Data Storage 3.1. Foundations of Computer Science Cengage Learning

Cabri Geometry Application User Guide

Intersection of a Line and a Convex. Hull of Points Cloud

Volumes of Revolution

Computer Animation: Art, Science and Criticism

Visualization and Feature Extraction, FLOW Spring School 2016 Prof. Dr. Tino Weinkauf. Flow Visualization. Image-Based Methods (integration-based)

Imaging Systems Laboratory II. Laboratory 4: Basic Lens Design in OSLO April 2 & 4, 2002

Consolidated Visualization of Enormous 3D Scan Point Clouds with Scanopy

Overview Motivation and applications Challenges. Dynamic Volume Computation and Visualization on the GPU. GPU feature requests Conclusions

The Essentials of CAGD

Architecture for Direct Model-to-Part CNC Manufacturing

3D Analysis and Surface Modeling

Using Photorealistic RenderMan for High-Quality Direct Volume Rendering

PowerPoint: Graphics and SmartArt

Equations, Lenses and Fractions

Examples. Pac-Man, Frogger, Tempest, Joust,

An introduction to Global Illumination. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Basic Shapes. Most paintings can be broken down into basic shapes. See how this famous painting by Cézanne can be broken down into basic shapes.

Vector storage and access; algorithms in GIS. This is lecture 6

A Crash Course on Programmable Graphics Hardware

GRAFICA - A COMPUTER GRAPHICS TEACHING ASSISTANT. Andreas Savva, George Ioannou, Vasso Stylianou, and George Portides, University of Nicosia Cyprus

Academic Support Center. Using the TI-83/84+ Graphing Calculator PART II

Intel Graphics Media Accelerator 900

Intermediate Tutorials Modeling - Trees. 3d studio max. 3d studio max. Tree Modeling Matthew D'Onofrio Page 1 of 12

Cartoon-Looking Rendering of 3D-Scenes

also describes the method used to collect the data for the faces. These techniques could be used to animate other flexible surfaces.

Angle - a figure formed by two rays or two line segments with a common endpoint called the vertex of the angle; angles are measured in degrees

EdExcel Decision Mathematics 1

Drawing Lines with Pixels. Joshua Scott March 2012

PRODUCT LIFECYCLE MANAGEMENT COMPETENCY CENTRE RENDERING. PLMCC, JSS Academy of Technical Education, Noida Rendering 1 of 16

MobiX3D: a player for displaying 3D content on mobile devices

Geometry Chapter Point (pt) 1.1 Coplanar (1.1) 1.1 Space (1.1) 1.2 Line Segment (seg) 1.2 Measure of a Segment

Transcription:

The Traditional Graphics Pipeline Last Time? Planar Shadows Projective Texture Shadows Shadow Maps Shadow Volumes Stencil Buffer frame buffer depth buffer stencil buffer Today Ray Casting / Tracing Ray Casting / Tracing vs. Traditional Graphics Pipeline Rasterization/ Advantages? Smooth variation of normal, silhouettes Generality: can render anything that can be intersected with a ray Atomic operation, allows recursion Disadvantages? Time complexity (N objects, R pixels) Usually too slow for interactive applications Hard to implement in hardware (lacks computation coherence, must fit entire scene in memory) How Do We Render Interactively? Use graphics hardware (the graphics pipeline), via OpenGL, MesaGL, or DirectX Graphics Pipeline (OpenGL) Ray Tracing Most global effects available in ray tracing will be sacrificed, but some can be approximated Given a primitive's vertices & the illumination at each vertex: Figure out which pixels to "turn on" to render the primitive Interpolate the illumination values to "fill in" the primitive At each pixel, keep track of the closest primitive (z-buffer) glbegin(gl_triangles) glnormal3f(...) glvertex3f(...) glvertex3f(...) glvertex3f(...) glend(); 1

Limitations of Restricted to scan-convertible primitives Object polygonization Faceting, shading artifacts Effective resolution is hardware dependent No handling of shadows, reflection, transparency Problem of overdraw (high depth complexity) What if there are many more triangles than pixels? scan conversion flat shading ray tracing scan conversion gouraud shading Ray Casting vs. Rendering Pipeline Ray Casting For each pixel For each object Send pixels to the scene Discretize first Rendering Pipeline For each triangle For each pixel Project scene to the pixels Discretize last Ray Casting vs. Rendering Pipeline Ray Casting For each pixel For each object Whole scene must be in memory Depth complexity: no computation for hidden parts Atomic computation More general, more flexible Primitives, lighting effects, adaptive antialiasing Rendering Pipeline For each triangle For each pixel Primitives processed one at a time Coherence: geometric transforms for vertices only Early stages involve analytic processing Computation increases with depth of the pipeline Good bandwidth/computation ratio Sampling occurs late in the pipeline Minimal state required Questions? Today Ray Casting / Tracing vs. Traditional Graphics Pipeline Rasterization/ The Graphics Pipeline 2

The Graphics Pipeline Primitives are processed in a series of stages Each stage forwards its result on to the next stage The pipeline can be drawn and implemented in different ways Some stages may be in hardware, others in software Optimizations & additional programmability are available at some stages 3D models defined in their own coordinate system (object space) transforms orient the models within a common coordinate frame (world space) Object space World space (Lighting) Vertices lit (shaded) according to material properties, surface properties (normal) and light sources Local lighting model (Diffuse, Ambient, Phong, etc.) Maps world space to eye space Viewing position is transformed to origin & direction is oriented along some axis (usually z) Eye space World space Transform to Normalized Device Coordinates (NDC) The objects are projected to the 2D image place (screen space) Eye space Portions of the object outside the view volume (view frustum) are removed NDC NDC Screen Space 3

Rasterizes objects into pixels Interpolate values as we go (color, depth, etc.) Each pixel remembers the closest object (depth buffer) Almost every step in the graphics pipeline involves a change of coordinate system. are central to understanding 3D computer graphics. Questions? Today Ray Casting / Tracing vs. Traditional Graphics Pipeline Coordinate Systems Rasterization/ Common Coordinate Systems Object space local to each object World space common to all objects Eye space / Camera space derived from view frustum Clip space / Normalized Device Coordinates (NDC) [-1,-1,-1] [1,1,1] Screen space indexed according to hardware attributes Coordinate Systems in the Pipeline Object space World space Eye Space / Camera Space Clip Space (NDC) Screen Space 4

Normalized Device Coordinates What if the p z is > eye z? is more efficient in a rectangular, axis-aligned volume: (-1,-1,-1) (1,1,1) OR (0,0,0) (1,1,1) (eye x, eye y, eye z ) z axis + image plane What if the p z is < eye z? What if the p z = eye z? (eye x, eye y, eye z ) z axis + (eye x, eye y, eye z ) z axis + image plane??? image plane Eliminate portions of objects outside the viewing frustum View Frustum boundaries of the image plane projected in 3D left a near & far clipping plane User may define additional clipping near planes far top right bottom Why Clip? Avoid degeneracies Don t draw stuff behind the eye Avoid division by 0 and overflow Efficiency Don t waste time on objects outside the image boundary Other graphics applications (often non-convex) Hidden-surface removal, Shadows, Picking, Binning, CSG (Boolean) operations (2D & 3D) 5

Strategies The Graphics Pipeline Don t clip (and hope for the best) Clip on-the-fly during rasterization Analytical clipping: alter input geometry Former hardware relied on full clipping Modern hardware mostly avoids clipping Only with respect to plane z=0 In general, it is useful to learn clipping because it is similar to many geometric algorithms Questions? Today Ray Casting / Tracing vs. Traditional Graphics Pipeline Rasterization/ Line Rasterization Triangle Rasterization 2D Geometric primitives (point, line, polygon, circle, polyhedron, sphere... ) Primitives are continuous; screen is discrete : algorithms for efficient generation of the samples comprising this approximation Scan Converting 2D Line Segments Given: Segment endpoints (integers x1, y1; x2, y2) Identify: Set of pixels (x, y) to display for segment 6

Line Rasterization Requirements Transform continuous primitive into discrete samples Uniform thickness & brightness Continuous appearance No gaps Accuracy Speed Algorithm Design Choices Assume: m = dy/dx, 0 < m < 1 Exactly one pixel per column fewer disconnected, more too thick Naive Line Rasterization Algorithm Simply compute y as a function of x Conceptually: move vertical scan line from x1 to x2 What is the expression of y as function of x? Set pixel (x, round (y(x))) y x x x1 y = y1 + ( y2 y1) x2 x1 = y1 + m( x x1) dy m = dx Efficiency Computing y value is expensive y = y1 + m( x x1) Observe: y += m at each x step (m = dy/dx) y(x+1) y(x+1) y(x) m y(x) x x+1 x x+1 Bresenham's Algorithm (DDA) Select pixel vertically closest to line segment intuitive, efficient, pixel center always within 0.5 vertically Generalize to handle all eight octants using symmetry Can be modified to use only integer arithmetic Line Rasterization & Grid Marching Can be used for ray-casting acceleration March a ray through a grid Collect all grid cells, not just 1 per column (or row) 7

Questions? Brute force solution for triangles For each pixel Compute line equations at pixel center clip against the triangle Problem? Brute force solution for triangles For each pixel Compute line equations at pixel center clip against the triangle Problem? If the triangle is small, a lot of useless computation Brute force solution for triangles Improvement: Compute only for the screen bounding box of the triangle How do we get such a bounding box? Xmin, Xmax, Ymin, Ymax of the triangle vertices Can we do better? Kind of! We compute the line equation for many useless pixels What could we do? Scan-line Rasterization Compute the boundary pixels Fill the spans Interpolate vertex color along the edges & spans! 8

But These Days Triangles are usually very small Setup cost are becoming more troublesome is annoying Brute force is tractable Modern Rasterization For every triangle Compute Compute bbox, clip bbox to screen limits For all pixels in bbox Compute line equations If all line equations>0 //pixel [x,y] in triangle Framebuffer[x,y]=triangleColor Questions? Reading for Today: Ray Tracing on Programmable Graphics Hardware Purcell, Buck, Mark, & Hanrahan SIGGRAPH 2002 Post a comment or question on the LMS discussion by 10am on Tuesday 3/18 Reading for Friday 3/21: MoXi: Real-Time Ink Dispersion in Absorbent Paper, Chu & Tai, SIGGRAPH 2005 Post a comment or question on the LMS discussion by 10am on Friday 3/21 9