Graphics Pipeline Rasterization CMSC 435/634. Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization.

Slides:



Advertisements
Similar presentations
Polygon Scan Conversion – 11b
Advertisements

Computer Graphics- SCC 342
Scan Conversion A. Samal. Scan Conversion Last step in the graphics pipeline Efficiency is a central issue Common primitives – Lines – Polygons – Circles.
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Interpolation Clipping.
Informationsteknologi Thursday, November 22, 2007Computer Graphics - Class 111 Today’s class Clipping Parametric and point-normal form of lines Intersecting.
Output Primitives Computer Graphics.
Implementation Dr. Amy Zhang. Reading 2  Hill, Chapters  Hill, Chapter 10.
Implementation III Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
1 Jinxiang Chai CSCE 441 Computer Graphics. 2 Midterm Time: 10:10pm-11:20pm, 10/20 Location: HRBB 113.
Status – Week 280 Victor Moya. Rasterization Setup triangles. Setup triangles. Fill triangle: Interpolate parameters. Fill triangle: Interpolate parameters.
Graphics Pipeline Clipping CMSC 435/634. Graphics Pipeline Object-order approach to rendering Sequence of operations – Vertex processing – Transforms.
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.
CGMB 314 Intro to Computer Graphics Fill Area Primitives.
Polygon Scan Conversion and Z-Buffering
Dr. Scott Schaefer Scan Conversion of Lines. 2/78 Displays – Cathode Ray Tube.
1/1/20001 Topic >>>> Scan Conversion CSE Computer Graphics.
Graphics Pipeline Rasterization CMSC 435/634. Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization.
3/4/04© University of Wisconsin, CS559 Spring 2004 Last Time Clipping Lines –Cohen-Sutherland: The use of outcodes and early reject/accept tests –Liang-Barsky:
Rasterization Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by David Luebke)
Triangle Scan Conversion. 2 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Rasterization Rasterization (scan conversion) –Determine which.
Graphics Pipeline Rasterization CMSC 435/634. Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization.
College of Computer and Information Science, Northeastern UniversityOctober 12, CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2006.
1Computer Graphics Implementation III Lecture 17 John Shearer Culture Lab – space 2
Introduction to Computer Graphics with WebGL
CS 480/680 Computer Graphics Implementation III Dr. Frederick C Harris, Jr. Fall 2011.
10/15/02 (c) 2002 University of Wisconsin, CS559 Last Time Clipping.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 2D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CAP4730: Computational Structures in Computer Graphics
Hidden Surface Removal
CS559: Computer Graphics Lecture 9: Rasterization Li Zhang Spring 2008.
1 Visiblity: Culling and Clipping Computer Graphics COMP 770 (236) Spring 2009 January 21 & 26: 2009.
Computer Graphics Drawing Line. Lines and Polylines Convex: For every pair of points in the polygon, the line between them is fully contained in the polygon.
Introduction to Computer Graphics CS 445 / 645 Lecture 9 Chapter 4: Rasterization L. McMillan MIT notes (Fall ’98)
10/15/02 (c) 2002 University of Wisconsin, CS559 Who Am I? Prof Stephen Chenney These notes will be online after the lecture – in fact they’re online already.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner Rasterization.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
1 CSCE 441 Lecture 2: Scan Conversion of Lines Jinxiang Chai.
Graphics Pipeline Rasterization CMSC 435/634. Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization.
Lecture 15: Raster Graphics and Scan Conversion
Lecture 13: Raster Graphics and Scan Conversion
Rasterization Overview Raster Display Device. Scan Conversion / Rasterization: converting vector graphics into raster graphics (determining pixels in.
Computer Graphics CC416 Week 14 Filling Algorithms.
Midterm Review Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Rasterization CENG 477 Introduction to Computer Graphics Slides from Steve Marschner, CS4620, 2008 Cornell University.
Computer Graphics I, Fall 2010 Scan conversion algorithms.
Rasterization, or “What is glBegin(GL_LINES) really doing?” Course web page: February 23, 2012  Lecture 4.
OUTPUT PRIMITIVES CEng 477 Computer Graphics METU, 2004.
CENG 477 Introduction to Computer Graphics
Introduction to Polygons
CS G140 Graduate Computer Graphics
(c) 2002 University of Wisconsin, CS559
CS 4731: Computer Graphics Lecture 20: Raster Graphics Part 1
Computer Graphics Filled Area Primitives II Lecture 09 Taqdees A
University of New Mexico
Implementation III.
Introduction to Computer Graphics with WebGL
CSCE 441 Lecture 2: Scan Conversion of Lines
© University of Wisconsin, CS559 Fall 2004
Introduction to Computer Graphics
Rasterization and Antialiasing
Joshua Barczak* CMSC 435 UMBC
Lecture 13 Clipping & Scan Conversion
Computer Graphics Implementation III
Rasterization and Antialiasing
Rasterization Week 6, Mon Feb 12
Chapter 3 Graphics Output Primitives
Where We Stand At this point we know how to: Next thing:
Implementation III Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

Graphics Pipeline Rasterization CMSC 435/634

Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization or Scan Conversion – Find pixels for a primitive – Usually for algorithms that generate all pixels for one primitive at a time – Compare to ray tracing: all primitives for one pixel

Line Drawing Given endpoints of line, which pixels to draw?

Line Drawing Given endpoints of line, which pixels to draw?

Assume one pixel per column (x index), which row (y index)? Choose based on relation of line to midpoint between candidate pixels ? ? Line Drawing ? ? ? ? ? ?

Choose with decision variable Plug midpoint into implicit line equation Incremental update

Line Drawing Implicit line equation Midpoint algorithm y = y 0 d = f(x 0 +1, y ) for x = x 0 to x 1 draw(x,y) if (d < 0) then y = y+1 d = d + (x 1 - x 0 ) + (y 0 - y 1 ) else d = d + (y 0 - y 1 )

Polygon Rasterization Problem – How to generate filled polygons (by determining which pixel positions are inside the polygon) – Conversion from continuous to discrete domain Concepts – Spatial coherence – Span coherence – Edge coherence

Scanning Rectangles for ( y from y 0 to y 1 ) for ( x from x 0 to x 1 ) Write Pixel (x, y)

Scanning Rectangles (2) for ( y from y 0 to y 1 ) for ( x from x 0 to x 1 ) Write Pixel (x, y)

Scanning Rectangles (3) for ( y from y 0 to y 1 ) for ( x from x 0 to x 1 ) Write Pixel (x, y)

Barycentric Coordinates Use non-orthogonal coordinates to describe position relative to vertices – Scaled edge equations 0 on edge, 1 at opposite vertex

Barycentric Example

Barycentric Coordinates Computing coordinates – Equations for ,  and  in book – Solutions to linear equations of x,y Ratio of areas / ratio of cross products – Area = 0.5*b*h – Length of cross product = 2*area of triangle Matrix form

Area Computation

Barycentric Matrix Computation

“Clipless” Homogeneous Rasterization Extra edge equations for clip edges – Compute clip plane at each vertex – Only visible (w>near) pixels will be drawn Adds computation, – But avoids branching and extra triangles – Good for hardware

Barycentric Rasterization For all x do For all y do Compute ( , ,  ) for (x,y) If (   [0,1] and   [0,1] and   [0,1] then c =  c 0 +  c 1 +  c 2 Draw pixel (x,y) with color c

Barycentric Rasterization x min = floor(min(x 0,x 1,x 2 )) x max = ceiling(max(x 0,x 1,x 2 )) y min = floor(min(y 0,y 1,y 2 )) y max = ceiling(max(y 0,y 1,y 2 )) for y = y min to y max do for x = x min to x max do  = f 12 (x,y)/f 12 (x 0,y 0 )  = f 20 (x,y)/f 20 (x 1,y 1 )  = f 01 (x,y)/f 01 (x 2,y 2 ) If (   [0,1] and   [0,1] and   [0,1] then c =  c 0 +  c 1 +  c 2 Draw pixel (x,y) with color c

Incremental Computation , , and  are linear in x and y What about  (x+1,y)?