
Graphics Pipeline Rasterization and Drawing Concepts for Rendering
Explore the key concepts of graphics pipeline rasterization, drawing primitives, line algorithms, and polygon rasterization in this informative collection. Learn about visible parts of primitives, shading, pixel generation, and more in the rendering process.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Graphics Pipeline Rasterization CMSC 435/634
Graphics Pipeline Object-order approach to rendering Transformations Vertex components of shading Vertex Processing Find the visible parts of primitives Clipping Break primitives into fragments/pixels Rasterization Fragment Processing Fragment components of shading Which do we see, how do they combine? Visibility & Blending
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?
Line Drawing Given endpoints of line, which pixels to draw? ? ? ? ? ? ? ? ? Assume one pixel per x. Which y? Look at midpoint between candidate pixels
Line Drawing Plug midpoint into implicit line equation Sign decides: called a decision variable Incremental update
Line Drawing Implicit line equation Midpoint algorithm y = y0 d = f(x0+1, y0+0.5) for x = x0 to x1 draw(x,y) if (d < 0) then y = y+1 d += (x1 - x0) + (y0 - y1) else d += (y0 - y1)
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 y0 to y1 ) for ( x from x0 to x1 ) Write Pixel (x, y)
Scanning Rectangles (2) for ( y from y0 to y1 ) for ( x from x0 to x1 ) Write Pixel (x, y)
Scanning Rectangles (3) for ( y from y0 to y1 ) for ( x from x0 to x1 ) Write Pixel (x, y)
Triangle Rasterization Barycentric coordinates are decision variables
Interpolation Use same barycentrics for any other per-vertex parameter Color: Normals: Texture coordinates:
Barycentric Triangle Rasterization For all y in ymin to ymax do For all x in xmin to xmax do Compute ( , , ) for (x,y) If ( 0 and 0 and 0) then c = c0 + c1 + c2 Draw pixel(x,y) with color c
Incremental Computation , , and are linear in X and Y What about pixel-to-pixel updates?
Incremental Rasterization ( row, row, row) = Compute ( , , ) for (xmin,ymin) For all y in ymin to ymax do ( , , ) = ( row, row, row) ( row, row, row) += (b , b , b ) For all x in xmin to xmax do If ( 0 and 0 and 0) then c = c0 + c1 + c2 Draw pixel(x,y) with color c ( , , ) += (a , a , a )
Homogeneous Barycentrics Each barycentric is Equal to 1 at one vertex Equal to 0 at the other two
Homogeneous Barycentrics Write formula for barycentric coordinate in homogeneous form
Homogeneous Barycentrics This defines a system of three equations or
Homogeneous Barycentrics Equation (again) Which we can solve:
Homogeneous Barycentrics Coefficients for all three:
Homogeneous Barycentrics Rows of inverse matrix
Changes to Rasterization NONE! Coefficients computed with homogeneous coords But they re the same coefficients!