Download presentation

Presentation is loading. Please wait.

Published byChristiana Jenkins Modified about 1 year ago

1
David Luebke1/19/99 CS 551/651: Antialiasing David Luebke cs551dl@cs.virginia.eduhttp://www.cs.virginia.edu/~cs551dl

2
David Luebke1/19/99 Administrivia Hand in Assignment 1 Hand in Assignment 1 Assignment 2: upcoming Assignment 2: upcoming –Sampling strategies in RSRT –Due Tuesday March 9

3
David Luebke1/19/99 Recap: Antialiasing Strategies Prefiltering: low-pass filter the signal before sampling Prefiltering: low-pass filter the signal before sampling –Pros: Guaranteed to eliminate aliasing Guaranteed to eliminate aliasing Preserves all desired frequencies Preserves all desired frequencies –Cons: Expensive Expensive Can introduce “ringing” Can introduce “ringing” Doesn’t fit most rendering algorithms Doesn’t fit most rendering algorithms

4
David Luebke1/19/99 Recap: Antialiasing Strategies Supersampling: sample at higher resolution, then filter down Supersampling: sample at higher resolution, then filter down –Pros: Conceptually simple Conceptually simple Easy to retrofit existing renderers Easy to retrofit existing renderers Works well most of the time Works well most of the time –Cons: High storage costs High storage costs Doesn’t eliminate aliasing, just shifts Nyquist limit upwards Doesn’t eliminate aliasing, just shifts Nyquist limit upwards

5
David Luebke1/19/99 Recap: Antialiasing Strategies A-Buffer: approximate prefiltering of continuous signal by sampling A-Buffer: approximate prefiltering of continuous signal by sampling –Pros: Integrating with scan-line renderer keeps storage costs low Integrating with scan-line renderer keeps storage costs low Can be efficiently implemented with clever bitwise operations Can be efficiently implemented with clever bitwise operations –Cons: Still basically a supersampling approach Still basically a supersampling approach Doesn’t integrate with ray-tracing Doesn’t integrate with ray-tracing

6
David Luebke1/19/99 Recap: Antialiasing Strategies Stochastic supersampling: convert high frequencies into noise Stochastic supersampling: convert high frequencies into noise –Pros: Retains advantages of supersampling Retains advantages of supersampling Noise is visually better than aliasing Noise is visually better than aliasing –Cons: Harder to retrofit Z-buffer Harder to retrofit Z-buffer Ideal sampling distribution (Poisson Disc) is expensive Ideal sampling distribution (Poisson Disc) is expensive

7
David Luebke1/19/99 Recap: Antialiasing Examples See Watt & Watt, p 120 See Watt & Watt, p 120 See Foley & van Dam, p 644-645 See Foley & van Dam, p 644-645

8
David Luebke1/19/99 Nonuniform Supersampling We’ve discussed two nonuniform sampling approaches We’ve discussed two nonuniform sampling approaches –Adaptive supersampling: Sample (say) once per pixel, then supersample if intensity changes a lot Sample (say) once per pixel, then supersample if intensity changes a lot –Stochastic supersampling: Use multiple samples per pixel, but not on a uniform grid Use multiple samples per pixel, but not on a uniform grid Can we filter nonuniform supersampled images? Can we filter nonuniform supersampled images?

9
David Luebke1/19/99 Nonuniform Supersampling Recall: convolution I’ of filter h with image function I is given by: Recall: convolution I’ of filter h with image function I is given by: I’(x,y) = I(i, j) h(x-i, y-j) Can we use this equation for nonuniform sampling? Can we use this equation for nonuniform sampling? Implicit in this equation is a normalizing factor: we assume the filter weights sum to unity Implicit in this equation is a normalizing factor: we assume the filter weights sum to unity

10
David Luebke1/19/99 Nonuniform Supersampling Pixel

11
David Luebke1/19/99 Nonuniform Supersampling Sampling Grid

12
David Luebke1/19/99 Nonuniform Supersampling Polygon

13
David Luebke1/19/99 Nonuniform Supersampling Adaptive Sampling

14
David Luebke1/19/99 Nonuniform Supersampling Final Samples Problem: Problem: –Many more red samples than blue samples –But final pixel actually more blue than red! –Simple filtering will not handle this correctly

15
David Luebke1/19/99 Nonuniform Supersampling Approximate answer: weighted average filter Approximate answer: weighted average filter –Divide total value of samples X filter by total value of filter at sample points: I(i, j) h(x-i, y-j) h(x-i, y-j) I’(x,y) =

16
David Luebke1/19/99 Nonuniform Supersampling Correct answer: multistage filtering Correct answer: multistage filtering –Use weighted-average filters in cascade, sequentially applying filters with lower and lower cutoff frequencies –What do such filters look like?

17
David Luebke1/19/99 Nonuniform Supersampling Real-world answer: ignore the problem Real-world answer: ignore the problem –Keep random components small compared to filter width –Use standard supersampling filter –Cook ‘87 (REYES) uses 4x4 jittered supersampling

18
David Luebke1/19/99 Antialiasing and Texture Mapping We may want to apply antialiasing techniques to the texture mapping process separately from the rest of the rendering process We may want to apply antialiasing techniques to the texture mapping process separately from the rest of the rendering process Why? Why?

19
David Luebke1/19/99 Antialiasing and Texture Mapping Texture mapping is uniquely harder Texture mapping is uniquely harder –Coherent textures present pathological artifacts –Correct filter shape changes Texture mapping is uniquely easier Texture mapping is uniquely easier –Textures are known ahead of time –They can thus be prefiltered

20
David Luebke1/19/99 Antialiasing and Texture Mapping More on texture problems More on texture problems –Coherent texture frequencies become infinitely high with increasing distance Ex: checkerboard receding to horizon Ex: checkerboard receding to horizon –Unfiltered textures lead to compression Ex: pixel covers entire checkerboard Ex: pixel covers entire checkerboard Unfiltered mapping: pixel is black or white Unfiltered mapping: pixel is black or white Moving checkerboard flashing pixels Moving checkerboard flashing pixels

21
David Luebke1/19/99 Antialiasing and Texture Mapping Problem: a square pixel on screen becomes a curvilinear quadrilateral in texture map (see W&W, p 140) Problem: a square pixel on screen becomes a curvilinear quadrilateral in texture map (see W&W, p 140) The coverage and area of this shape change as a function of the mapping The coverage and area of this shape change as a function of the mapping Most texture antialiasing algorithms approximate this shape somehow Most texture antialiasing algorithms approximate this shape somehow

22
David Luebke1/19/99 Antialiasing and Texture Mapping Mip-mapping Mip-mapping –MIP = Multim in Parvo (many things in a small place) –Ignores shape change of inverse pixel –But allows size to vary Idea: store texture as a pyramid of progressively lower-resolution images, filtered down from original Idea: store texture as a pyramid of progressively lower-resolution images, filtered down from original

23
David Luebke1/19/99 Antialiasing: Mip-Mapping Depth of Mip-Map

24
David Luebke1/19/99 G Antialiasing: Mip Mapping R B RG B RG B B GR

25
David Luebke1/19/99 Antialiasing: Mip Mapping Distant textures use higher levels of the mipmap Distant textures use higher levels of the mipmap Thus, the texture map is prefiltered Thus, the texture map is prefiltered Thus, reduced aliasing! Thus, reduced aliasing!

26
David Luebke1/19/99 Antialiasing: Mip Mapping Which level of mip-map to use? Which level of mip-map to use? –Think of mip-map as 3-D pyramid –Index into mip-map with 3 coordinates: u, v, d (depth) Q: What does d correspond to in the mip-map? Q: What does d correspond to in the mip-map? A: size of the filter A: size of the filter

27
David Luebke1/19/99 Antialiasing: Mip Mapping The size of the filter (i.e., d in the mip-map) depends on the pixel coverage area in the texture map The size of the filter (i.e., d in the mip-map) depends on the pixel coverage area in the texture map –In general, treat d as a continuous value –Blend between nearest mip-map level using linear interpolation Q: What is tri-linear interpolation? Q: What is tri-linear interpolation?

28
David Luebke1/19/99 Antialiasing: Mip Mapping Q: What’s wrong with the mip-map approach to prefiltering texture? Q: What’s wrong with the mip-map approach to prefiltering texture? A: Assumes pixel maps to square in texture space A: Assumes pixel maps to square in texture space More sophisticated inverse pixel filters (see F&vD p 828): More sophisticated inverse pixel filters (see F&vD p 828): –Summed area tables –Elliptical weighted average filtering

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google