Antialiasing. What is alias? Alias - A false signal in telecommunication links from beats between signal frequency and sampling frequency (from dictionary.com)

Slides:



Advertisements
Similar presentations
Sampling, Aliasing.
Advertisements

Technische Universität München Fakultät für Informatik Computer Graphics SS 2014 Sampling Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
CSE 781 Anti-aliasing for Texture Mapping. Quality considerations So far we just mapped one point – results in bad aliasing (resampling problems) We really.
David Luebke1/19/99 CS 551/651: Antialiasing David Luebke
MIT EECS 6.837, Durand and Cutler Sampling, Aliasing, & Mipmaps.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
Week 7 - Wednesday.  What did we talk about last time?  Transparency  Gamma correction  Started texturing.
CS 551 / CS 645 Antialiasing. What is a pixel? A pixel is not… –A box –A disk –A teeny tiny little light A pixel is a point –It has no dimension –It occupies.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi Some slides.
Sampling, Aliasing, & Mipmaps
Image Sampling Moire patterns
Advanced Computer Graphics (Spring 2006) COMS 4162, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
Lecture 3: Image Resampling CS4670: Computer Vision Noah Snavely Nearest-neighbor interpolation Input image 3x upsample hq3x interpolation (ZSNES)
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Image Sampling Moire patterns -
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
CSC418 Computer Graphics n Aliasing n Texture mapping.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 3 Ravi Ramamoorthi
Filtering theory: Battling Aliasing with Antialiasing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
© Chun-Fa Chang Sampling Theorem & Antialiasing. © Chun-Fa Chang Motivations “ My ray traced images have a lot more pixels than the TV screen. Why do.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
Image Resampling CS4670: Computer Vision Noah Snavely.
Image Resampling CS4670: Computer Vision Noah Snavely.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
Filtering Robert Lin April 29, Outline Why filter? Filtering for Graphics Sampling and Reconstruction Convolution The Fourier Transform Overview.
CS 450: COMPUTER GRAPHICS ANTIALIASING SPRING 2015 DR. MICHAEL J. REALE.
Week 6 - Wednesday.  What did we talk about last time?  Light  Material  Sensors.
Image Processing Edge detection Filtering: Noise suppresion.
1 Texture Mapping. 2 Texture Aliasing MIPmaps Environment Mapping Bump Mapping Displacement Mapping Shadow Maps Solid Textures Antialiasing.
09/19/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Dithering.
Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels.
Lecture Fall 2001 From S. Zeki, Inner Vision.
Digital Media Dr. Jim Rowan ITEC So far… We have compared bitmapped graphics and vector graphics We have discussed bitmapped images, some file formats.
Duy & Piotr. How to reconstruct a high quality image with the least amount of samples per pixel the least amount of resources And preserving the image.
MIT EECS Sampling, Aliasing, & Mipmaps. MIT EECS Last Time? Global illumination “physically accurate light transport” The rendering equation.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
Sampling Pixel is an area!! – Square, Rectangular, or Circular? How do we approximate the area? – Why bother? Color of one pixel Image Plane Areas represented.
Digital Media Dr. Jim Rowan ITEC Vector Graphics Elegant way to construct digital images that –have a compact representation –are scalable –are.
Sampling Theorem & Antialiasing
1 Dr. Scott Schaefer Antialiasing. 2/70 What is aliasing?
Projects Project 1a due this Friday Project 1b will go out on Friday to be done in pairs start looking for a partner now.
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Texturing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
Advanced Computer Graphics
Image Resampling & Interpolation
Attributes of Graphics Primitives Hearn & Baker Chapter 4
Week 7 - Wednesday CS361.
Image Sampling Moire patterns
Distributed Ray Tracing
Sampling Theorem & Antialiasing
Sampling and Antialiasing
Anti-aliasing for Texture Mapping
Antialiasing Dr. Scott Schaefer.
Sampling Theorem told us …
Joshua Barczak CMSC435 UMBC
Image Sampling Moire patterns
Digital Media Dr. Jim Rowan ITEC 2110.
Samuel Cheng Slide credits: Noah Snavely
Distributed Ray Tracing
Filtering Part 2: Image Sampling
Image Sampling Moire patterns
Image Resampling & Interpolation
Resampling.
Chapter XV Shadow Mapping
Samuel Cheng Slide credits: Noah Snavely
Distributed Ray Tracing
Presentation transcript:

Antialiasing

What is alias? Alias - A false signal in telecommunication links from beats between signal frequency and sampling frequency (from dictionary.com) Not just telecommunication, alias is everywhere in computer graphics because rendering is essentially a sampling process Examples: Jagged edges False texture patterns

Rendering is a sampling process? Yes indeed. Image display example

Rendering is a sampling process? Another example Render a smooth surface

Ssignal sampling and filtering Two important steps when information are represented digitally: sampling and reconstruction Alias can be caused by any of the steps

Alias caused by under-sampling Have you ever looked at an electric fan and found it is rotated in a reverse direction? Sample at only ¼ of the frequency Incorrect result is seen !! - under-sampling problem

Alias caused by under-sampling 1D signal sampling example Actual signal Sampled signal

How often is enough? What is the right sampling frequency? Sampling theorem (or Nyquist limit) - the sampling frequency has to be at least twice the maximum frequency of the signal to be sampled Need two samples in this cycle

Can alias be totally avoided Given the sampling theorem by Nyquist ? Not really – this is because the maximum frequency might be infinite, i.e., not bandlimited Most of graphics scenes are not bandlimited: sharp edges can never be completely sampled in a discrete manner (point sampling) We will talk about what we can do to correct alias for real time graphics

Strobe light on dripping water: Temporal aliasing Spokes on a rotating wheel: Temporal aliasing Moiré patterns: Spatial aliasing Examples of Aliasing

Antialiasing Lines Idea: Make line “fatter” Fade line out (removes high frequencies) Now sample the line

Antialiasing Lines Solution 1 – Unweighted Area Sampling: Treat line as a single-pixel wide rectangle Color pixels according to the percentage of each pixel that is “covered” by the rectangle

Solution 1: Unweighted Area Sampling Pixel area is unit square Constant weighting function Pixel color is determined by computing the amount of the pixel covered by the line, then shading accordingly Easy to compute, gives reasonable results Line One Pixel

Solution 2: Weighted Area Sampling  Treat pixel area as a circle with a radius of one pixel  Use a radially symmetric weighting function (e.g., cone) : Areas closer to the pixel center are weighted more heavily  Better results than unweighted, slightly higher cost Line One Pixel

Solution 3: Super-sampling Divide pixel up into “sub-pixels”: 2  2, 3  3, 4  4, etc. Sub-pixel is colored if inside line Pixel color is the average of its sub-pixel colors Easy to implement (in software and hardware) Expensive No antialiasingAntialiasing (2  2 super-sampling)

Different Supersampling Schemes The common formula: c(i,x,y): color of the ith sample for pixel(x,y) ; Wi: weight Different super-sampling schemes

Reconstruction After the (ideal) sampling is done, we still need to reconstruct back the original continuous signal The reconstruction is done by reconstruction filter

Reconstruction Filters Common reconstruction filters: Box filter Tent filter Sinc filter = sin(  x)/  x

Box filter Very simple, but not very good

Tent Filter Based on linear interpolation. Better, but still not smooth

Sinc Filter Ideal low-pass filter

Anti-aliased texture mapping The above anti-aliasing methods work better for removing jagged edges but not texture aliasing Two problems to address – Magnification Minification

Re-sampling Minification and Magnification – resample the signal to a different resolution Magnification Minification (note the minification is done badly here)

Magnification Simpler to handle, just resample the reconstructed signal Reconstructed signal Resample the reconstructed signal

Magnification Common methods: nearest neighbor (box filter) or linear interpolation (tent filter) Nearest neighbor bilinear interpolation

Minification Harder to handle The signal’s frequency is too high to avoid aliasing A possible solution: Increase the low pass filter width of the ideal sinc filter – this effectively blur the image Blur the image first (using any method), and then sample it

Minification Several texels cover one pixel (under sampling happens) Under sample artifact one pixel Solution: Either increase sampling rate or reduce the texture Frequency We will discuss: 1.Mip-mapping 2.Rip-mapping 3.Sum Area Table

Mip-mapping By Lance Williams (SIGGRAPH ’83) Mip – many things in a small place The original texture is augmented with a set of low resolution textures Which resolution to use depends on the screen projection size – try to maintain pixel to texel ration close to 1 average 2x2 texels

Mipmapping problem Overblurring! – When a pixel covers many u texels but few v texels, we always choose the largest pixel coverage to decide the level Non mipmapping mipmapping

Ripmapping Correct the over-blurring problem of mipmapping – separating x and y filtering Scale by half by x across a row. Scale by half in y going down a column. The diagonal has the equivalent mip-map. Four times the amount of storage is required. Four different texel values to average ?

Summed Area Table Another way to perform anisotropic filtering - can be used to compute the average color for any arbitrary rectangular region in the texture space at a constant speed A two dimensional array that has the same size as the texture Every pixel stores the sum of all the texel colors in the lower left corner

Summed Area Table (SAT) How to calculate the sum of texels in the area between A and B? R A B C D R = SAT[B] – SAT[C] – SAT[D] + SAT[A] The average value can be computed by R / num of texels in R

Summed Area Table (SAT) is used to filter the texture Compute the rectangular bounding box of the pixel area in the texture and then use summed area table to compute the average color (i.e., filter the texels when magnification takes place) pixel polygon Texture space x y

Summed Area Table Less blurry than Mipmapping Still blurry when the texture is viewed along its diagonal – the bounding box of the pixel area is larger than the actual pixel area pixel polygon Texture space x y not quit fit

Comparison Non filtering Mipmapping Summed area table Note that only mipmap is implemented by hardware and supported by OpenGL

Motion Blur – Temporal Antialias Tricky Simplest Solution: supersampling in time brute force approach motion blur increases temporal resolution Just as pixel antialiasing increases spatial resolution If an object moves 16 pixels in one frame, then 16 supersample images (or even less) should be adequate