GPU - Rasterisation (One)

GPU - Rasterisation (One)

[CS7031] Graphics and Console Hardware and Real-time Rendering 15th Lecture :: GPU - Rasterisation (one) Dr. Michael Manzke [email protected] Trinity College Dublin Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 1/34 Rasterisation or Scan Convertion Outline: Fundamentals System examples Special topics Suggested reading: Triangle Scan Conversion Using 2D Homogeneous Coordinates [OG97] Optimal Depth Buffer for Low-cost Graphic Hardware [LJ99] Minimum Triangle Seperation for Correct Z-buffer Occlusion [AS06] Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 2/34 Recall that... Straight lines project to straight lines: When projection is to a plan (our assumption) Only vertexes need to be transformed That’s why we’re interested in lines and polygones Parameterizations(e.g., projected distance) are warped: Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 3/34 Recall that ... Ideal screen coordinates are continuous Implementations always use discrete math, but with substantial sub-pixel precision A pixel is a big thing Addressable resolution equal to pixels on screen Lots of data Points and lines have no geometric area ... Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 4/34 Terminology Rasterisation: convertion of primitives to fragments Primitive: point, line, polygon, glyph, image, ... Fragment: transient data structure, e.g., short x,y; long depth; short r,g,b,a; Pixels exist in an array (e.g., framebuffer) Have implicit <x,y > cooordinates Fragment are routed to appropriate pixels This is the "sort" we saw in the previpus lecture There will be more sorting ... Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 5/34 Two Fundamental Operation Fragment selection Identify pixels for which fragment are to be generated Must be conservative, efficiency matters <x,y > paratemers are special Attribute assignment Assign attribute value to each fragment E.g., color, depth, ... Scheduling: the third fundamental operation Assign fragment to parallel fragment shaders Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 6/34 Fragment Selection Generate one fragment for each pixel that is intersected by the primitive Intersect could mean that the primitive’s area intersects the pixel’s: Centre point, or Square region, or Filter-function Some examples on the following slides: Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 7/34 Point Sampled Fragment Selection Aliased rasterisation Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 8/34 Box Sampled Fragment Selection Tiled rasterisation (scaling the primitive doesn’t do this) Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 9/34 Filtered Fragment Selection Antialiased rasterisation Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 10/34 Fragment Selection (continued) What if the primitive doesn’t have a geometric area? Points don’t Lines don’t Two choises Rule-based approach (e.g., Bresenham line) allow desired propertiies to be maintained, but may require additional hardware complexity Assign an screen-scace area (e.g. circle for point, rectangle for line) can utilize polygon rasterisation algprithm, but may result in wavy lines, flashing points, etc. Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 11/34 Attribute Assignment Identify a parameterisation for each attribute e.g. planar Sample this parameterisation as required Which parameterisation? Lots of possiblities (linear, cuic, ...) Always define implisitly by vertex values Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 12/34 Attribute Assignment Properties of vertex-defined parameterisation: Zero-order continuity If fully specified by the two vertexes that specify the edge Triangle allow planar parameterisation Polygons (4+ edges) are (almost) never planar Parameterisation may vary with screen orientation Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 13/34 Linear Interpolation Compute intermediate attribute value Along a line: A = aA1 + bA2, a + b =1 On a plan: A = aA1 + bA2 + cA3, a + b + c =1 Only projected values interpolate linearly in screen space (straight lines project to straight lines) a and y are projected (divided by w) Attribute values are not naturally projected Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 14/34 Linear Interpolation Choice for attribute interpolation in screen space Interpolate unprojected values Cheap and easy to do, but gives wrong values Sometimes OK for color, but Never acceptable for texture coordinates Do it right Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 15/34 Incorrect Attribute Interpolation Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 16/34 Perspective-correct Linear Interpolation Only projected values interpolate correctly, so project A A1 A2 Lineatly interpolate w1 and w2 1 1 Also interpolate w1 and w2 These also interpolate linearly in screen space Divide interpolants at each sample point to recover A A w 1 = A w Division is expensive (more than add or multiply, so) Recover w for the sample point (reciprocate), and Multiply each projected attribute by w Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 17/34 Perspective-correct Linear Interpolation Barycentric triangle parameterization: aA1 bA2 cA3 + + w1 w2 w3 A = a b c + + w1 w2 w3 a + b + c =1 Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 18/34 Example: Gouraud Shaded Quadrilateral Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 19/34 Example: Gouraud Shaded Quadrilateral Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 20/34 All Polygons are Triangles Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 21/34 Normal-based Quad Decomposition Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 22/34 Point Sampled Triangles Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 23/34 Point Sampled Points and Lines Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 24/34 Outline Problem Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 25/34 Integer DDA Arithmetric Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 26/34 Triangle Rasterisation Examples Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 27/34 Algorithm Properties Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 28/34 Gouraud Shaded (GTX) Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 29/34 Engine per Pixel (Pixel Plane 4) Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 30/34 Engine per Pixel (Pixel Plane 4) Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 31/34 Pixel Planes 4 Fragment Selection Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 32/34 References [OG97] Marc Olano and Trey Greer. Triangle scan conversion using 2d homogeneous coordinates. In HWWS '97: Proceedings of the ACM SIGGRAPH/EUROGRAPHICS workshop on Graphics hardware, pages 89–95, New York, NY, USA, 1997. ACM. [LJ99] Eugene Lapidous and Guofang Jiao. Optimal depth buffer for low-cost graphics hardware. In HWWS '99: Proceedings of the ACM SIGGRAPH/EUROGRAPHICS workshop on Graphics hardware, pages 67–73, New York, NY, USA, 1999. ACM. Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 33/34 References [AS06] Kurt Akeley and Jonathan Su. Minimum triangle separation for correct z-buffer occlusion. In GH '06: Proceedings of the 21st ACM SIGGRAPH/Eurographics symposium on Graphics hardware, pages 27–30, New York, NY, USA, 2006. ACM. Dr. Michael Manzke - CS7031 :: 15th Lecture :: GPU - Rasterisation (one) :: December 20, 2010 – p. 34/34.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    34 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us