Aliasing & Antialiasing David Luebke 1 7/27/2016 Assn 4 continued ● Hopefully, assignment 4a was easy ■ Except for learning all the Cg infrastructure ● Next up: Toon shading ■ Explain toon shading ■ Warm up: express your Phong shader as an NV30 fragment program ■ Then: write a toon shader as a NV30 fragment program ■ Extra credit: write a toon shader that runs on GF2X (GeForce 3/4) ● Who wants a ray tracing assignment? David Luebke 2 7/27/2016 Antialiasing ● Aliasing: signal processing term with very specific meaning ● Aliasing: computer graphics term for any unwanted visual artifact ● Antialiasing: computer graphics term for avoiding unwanted artifacts ● We’ll tackle these in order David Luebke 3 7/27/2016 Signal Processing ● Raster display: regular sampling of a continuous function (Really?) ● Think about sampling a 1-D function: David Luebke 4 7/27/2016 Signal Processing ● Sampling a 1-D function: David Luebke 5 7/27/2016 Signal Processing ● Sampling a 1-D function: David Luebke 6 7/27/2016 Signal Processing ● Sampling a 1-D function: ■ What do you notice? David Luebke 7 7/27/2016 Signal Processing ● Sampling a 1-D function: what do you notice? ■ Jagged, not smooth David Luebke 8 7/27/2016 Signal Processing ● Sampling a 1-D function: what do you notice? ■ Jagged, not smooth ■ Loses information! David Luebke 9 7/27/2016 Signal Processing ● Sampling a 1-D function: what do you notice? ■ Jagged, not smooth ■ Loses information! ● What can we do about these? ■ Use higher-order reconstruction ■ Use more samples ■ How many more samples? David Luebke 10 7/27/2016 The Sampling Theorem ● Obviously, the more samples we take the better those samples approximate the original function ● The sampling theorem: A continuous bandlimited function can be completely represented by a set of equally spaced samples, if the samples occur at more than twice the frequency of the highest frequency component of the function David Luebke 11 7/27/2016 The Sampling Theorem ● In other words, to adequately capture a function with maximum frequency F, we need to sample it at frequency N = 2F. ● N is called the Nyquist limit. David Luebke 12 7/27/2016 The Sampling Theorem ● An example: sinusoids David Luebke 13 7/27/2016 The Sampling Theorem ● An example: sinusoids David Luebke 14 7/27/2016 The Sampling Theorem ● Show Figure 4.2 in Watt & Watt (p. 113) David Luebke 15 7/27/2016 Fourier Theory ● All our examples have been sinusoids ● Does this help with real world signals? Why? ● Fourier theory lets us decompose any signal into the sum of (a possibly infinite number of) sine waves ● Go to transparencies… David Luebke 16 7/27/2016