Study of Supersampling Methods for Computer Graphics Hardware Antialiasing
Total Page:16
File Type:pdf, Size:1020Kb
Study of Supersampling Methods for Computer Graphics Hardware Antialiasing Michael E. Goss and Kevin Wu [email protected] Visual Computing Department Hewlett-Packard Laboratories Palo Alto, California December 5, 2000 Abstract A study of computer graphics antialiasing methods was done with the goal of determining which methods could be used in future computer graphics hardware accelerators to provide improved image quality at acceptable cost and with acceptable performance. The study focused on supersampling techniques, looking in detail at various sampling patterns and resampling filters. This report presents a detailed discussion of theoretical issues involved in aliasing in computer graphics images, and also presents the results of two sets of experiments designed to show the results of techniques that may be candidates for inclusion in future computer graphics hardware. Table of Contents 1. Introduction ........................................................................................................................... 1 1.1 Graphics Hardware and Aliasing.....................................................................................1 1.2 Digital Images and Sampling..........................................................................................1 1.3 This Report...................................................................................................................... 2 2. Antialiasing for Raster Graphics via Filtering ...................................................................3 2.1 Signals and the Fourier Transform.................................................................................. 3 2.2 Systems............................................................................................................................ 5 2.3 Practical Resampling Filters ........................................................................................... 8 2.4 Application of Resampling Filters ................................................................................ 10 2.5 Results ........................................................................................................................... 13 3. Description of Supersampling Pattern Experiments ....................................................... 17 3.1 Software Implementation .............................................................................................. 18 3.2 Supersample patterns..................................................................................................... 18 3.2.1 Regular Grid.......................................................................................................... 18 3.2.2 Irregular Grid......................................................................................................... 18 3.2.2.1 N-Queens Supersampling.................................................................................. 18 3.2.2.2 Edge-Optimized Irregular Grid......................................................................... 19 3.2.3 Jittered Grid........................................................................................................... 20 3.3 Resampling filters.........................................................................................................22 3.3.1 Box Filter...............................................................................................................23 3.3.2 Tent Filter .............................................................................................................. 23 3.3.3 Gaussian ½ Filter................................................................................................... 24 3.4 Results ........................................................................................................................... 24 3.4.1 Box Filter...............................................................................................................24 3.4.1.1 Conventional Aliased Rendering....................................................................... 25 3.4.1.2 Regular Grid, Box Filter.................................................................................... 26 3.4.1.3 N-Queens Irregular Grid, Box Filter................................................................. 26 3.4.1.4 Edge-Optimized Irregular Grid, Box Filter....................................................... 27 3.4.1.5 Jittered Grid, Box Filter .................................................................................... 28 3.4.2 Tent Filter .............................................................................................................. 29 3.4.3 Gaussian ½ Filter................................................................................................... 31 3.4.4 Filter Comparisons................................................................................................ 33 3.4.5 Limits to Image Quality ........................................................................................ 34 3.4.6 Animation Results.................................................................................................35 4. Conclusions .......................................................................................................................... 36 - ii - Table of Figures Figure 1: Rasterization systems. (a) Conventional point sampling. (b) Ideal antialiasing with filtering. (c) Practical antialiasing with supersampling and filtering. ..................................... 6 Figure 2: Resampling filter impulse responses and normalized transfer functions. ....................... 9 Figure 3: Supersample locations (blue crosses) relative to final sample locations (red filled diamonds). Supersample rate N = 2 in left diagram; N = 3 in right diagram. ....................... 11 Figure 4: Configuration of 10 unique weights in an 8×8 even resampling filter. Each unique weight has a unique color and letter code. ............................................................................ 13 Figure 5: Pointed-sampled checkerboard pattern.......................................................................... 14 Figure 6: Antialiased checkerboard pattern. When viewing the page after a 90º clockwise rotation, the supersample rates from top to bottom are 2×2, 4×4, and 8×8, and the resampling-filter functions from left to right are rectangle, triangle, and cubic. .................. 15 Figure 7: Subjective antialiasing quality for the supersample rates and filters in Figure 6. ......... 16 Figure 8 – Frequency spectra for Poisson Disc and Uniform Jitter sample patterns .................... 21 Figure 9: Regular Grid, Box Filter................................................................................................ 25 Figure 10: N-Queens Irregular Grid, Box Filter ........................................................................... 27 Figure 11: Edge-Optimized Irregular Grid, Box Filter ................................................................. 28 Figure 12: Jittered Grid, Box Filter............................................................................................... 29 Figure 13: Regular Grid, Tent Filter.............................................................................................. 30 Figure 14: N-Queens Irregular Grid, Tent Filter ........................................................................... 30 Figure 15: Jittered Grid, Tent Filter............................................................................................... 31 Figure 16: Regular Grid, Gaussian ½ Filter.................................................................................. 31 Figure 17: N-Queens Irregular Grid, Gaussian ½ Filter ............................................................... 32 Figure 18: Jittered Grid, Gaussian ½ Filter................................................................................... 32 Figure 19: 4 sample per pixel filter comparison ........................................................................... 33 Figure 20: 16 sample per pixel filter comparison ......................................................................... 34 Figure 21: 256 samples per pixel, Jittered Grid, ........................................................................... 35 - iii - 1. Introduction 1.1 Graphics Hardware and Aliasing Graphics hardware accelerators have, almost without exception, used incremental raster conversion of lines and polygons as the primary method of rendering images. An undesirable side effect of this technique is the generation of “jaggies,” ragged stair-step patterns apparent on edges that are not oriented at exact multiples of 45 degrees. Aggregations of very small polygons also generate somewhat unpredictable results when the polygon size comes close to or below the size of one pixel. These effects are typically worsened in animation sequences, where false apparent motion of these artifacts proves very distracting to the viewer. These artifacts are two of the most common effects of aliasing. Aliasing is defined to occur when a continuous signal (in this case the image projection of the geometric model of a scene) is sampled (converted to discrete pixels) using sample locations (pixels) that are too widely spaced relative to the smallest details of the scene. Because mathematically defined lines and edges contain infinitely sharp edges (and thus infinitely small detail), it is not possible to exactly represent a computer graphics image using pixels. Antialiasing techniques attempt