1 / 25

COMP 5411: ADVANCED COMPUTER GRAPHICS FALL 2013

Rasterization. COMP 5411: ADVANCED COMPUTER GRAPHICS FALL 2013. Major steps of rendering pipeline. Vertex processing Triangle rasterization Pixel processing. Rasterization. From vertices and primitives to pixels (basics covered earlier in course). Before we start. Front-faces.

frey
Download Presentation

COMP 5411: ADVANCED COMPUTER GRAPHICS FALL 2013

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Rasterization COMP 5411: ADVANCED COMPUTER GRAPHICSFALL 2013

  2. Major steps of rendering pipeline Vertex processing Triangle rasterization Pixel processing

  3. Rasterization From vertices and primitives to pixels (basics covered earlier in course)

  4. Before we start

  5. Front-faces

  6. Back-faces

  7. Backface culling 2 2 3 3 1 1 • Don’t rasterize back-facing triangles • Or front-facing, you decide • Points and lines are always rasterized • One possible implementation • Look at 2D screen coordinates • Two possible orientations • No relation to vertex normals

  8. What if triangles share an edge? Image from “Advanced Rasterization”,Nicolas Capens, 2004 • Missing or repeated fragments • Neither triangle emits, both of them emit • Cracks or overdraw (when blending)

  9. The top-left rule Image from “Advanced Rasterization”,Nicolas Capens, 2004 • Pixel center inside: emit fragment • Center on edge: emit if top edge or left edge • Top edges are horizontal and above all others • Left edges are not horizontal and are to the left • Triangles can have one or two left edges

  10. Top-rule examples Image from “Microsoft’s Direct3D 10 Rasterization Rules”, 2010

  11. Interpolation Hardware does perspective correct interpolation Vertex shader == Pixel shaderoutput structure input structure

  12. The Z-Buffer Algorithm • Now that we have Z, we can compute visibility! • Use depth values from interpolation • Use an additional buffer to hold depth values • Render primitives in arbitrary order • Record their depths in the depth buffer • If the depth of a fragment about to be drawn is greater than what’s already there, throw it away • Image precision hidden surface removal (Covered earlier in class)

  13. Early Z culling When a fragment fails the Z-test, it can’t modify the frame-buffers What is the point of shading such fragments? Hardware tests Z first, and only runs shader on fragments that pass the Z-test

  14. HiZ culling • Hardware keeps a coarse version of Z-buffer • Stores maximum depth over a region • Entire blocks of fragments can be rejected • If min of new block larger than max of HiZ • Saves bandwidth and improves performance

  15. Keep Early Z and HiZ in mind • What happens if you modify Z inside a shader? • Early Z-culling and HiZ are disabled • Significant slowdown • What happens if you render back to front? • Early Z-culling and HiZ are ineffective • A lot of overdraw • Significant slowdown • You should try to render front to back • Counter-intuitive • Opposite of Painter’s algorithm

  16. Triangle rasterization issues Images from “Triangle Rasterization” Brandon Lloyd, 2007 Sliver triangles

  17. Triangle rasterization issues Images from “Triangle Rasterization” Brandon Lloyd, 2007 Moving sliver triangles

  18. Supersampling in hardware Hardware support for higher-quality strategies FSAA, MSAA, CSAA

  19. Full-scene antialiasing (FSAA) 2 samples 2 taps Sample more than once per pixel (samples) Filter to produce final pixel color (taps) There are many, many different options

  20. Full-scene antialiasing (FSAA) 2 samples 5 taps QUINCUNX Sample more than once per pixel (samples) Filter to produce final pixel color (taps) There are many, many different strategies

  21. FSAA comparison Images from “OpenGL Multisample” Sébastien Dominé, 2002

  22. FSAA comparison Images from “OpenGL Multisample” Sébastien Dominé, 2002

  23. Full-scene antialiasing (FSAA) 4 samples 4 taps RGSS 2 samples 4 taps FLIPQUAD Humans find aliasing at angles close to vertical and horizontal to be more disturbing Use pattern with more resolution for same cost

  24. Multisampleantialiasing (MSAA) • Rasterize at higher resolution • Shade at fragment resolution • Solves aliasing only across polygon edges • Which is usually more problematic • Smaller computational cost • Same memory cost

  25. Interesting new hardware functionality • Pixel shaders have access to subpixel position • Pixel shaders can set coverage mask • Pixel shaders can choose where to evaluate interpolated attributes • In other words • Rasterizer is slowly becoming programmable

More Related