CS 450: COMPUTER GRAPHICS ANTIALIASING SPRING 2015 DR. MICHAEL J. REALE.

Slides:



Advertisements
Similar presentations
Sampling, Aliasing.
Advertisements

The Framebuffer February 6, A Configurable Pixel Cache for Fast Image Generation, Gorris et al. Problem Processor speeds have increased to the point.
Sampling and Reconstruction
CS 445 / 645 Introduction to Computer Graphics Lecture 18 Antialiasing Antialiasing.
RealityEngine Graphics Kurt Akeley Silicon Graphics Computer Systems.
David Luebke 1 4/28/2015 Aliasing & Antialiasing.
Computer Graphics Viewing, Rendering, Antialiasing گرد آوري و تاليف: دكتر احمد رضا نقش نيل چي دانشگاه اصفهان گروه مهندسي كامپيوتر.
David Luebke1/19/99 CS 551/651: Antialiasing David Luebke
Ted Adelson’s checkerboard illusion. Motion illusion, rotating snakes.
MIT EECS 6.837, Durand and Cutler Sampling, Aliasing, & Mipmaps.
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.
Compositing and Blending - Chapter 8 modified by Ray Wisman Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Aliasing & Antialiasing
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi Some slides.
Sampling, Aliasing, & Mipmaps
Sampling and Pyramids : Rendering and Image Processing Alexei Efros …with lots of slides from Steve Seitz.
CSCE 641 Computer Graphics: Image Sampling and Reconstruction Jinxiang Chai.
Advanced Computer Graphics (Spring 2006) COMS 4162, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi
CS5520 Image-Based Rendering © Chun-Fa Chang, Spring 2003 Sampling Theorem & Antialiasing April 15, 2003.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
Aliasing and Anti-Aliasing Copyright Zachary Wartell, University of North Carolina at Charlotte, All Rights Reserved Revision: 10/24/2007 3:38:00 AM ©Zachary.
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 -
02/12/02 (c) 2002 University of Wisconsin, CS 559 Filters A filter is something that attenuates or enhances particular frequencies Easiest to visualize.
CSC418 Computer Graphics n Aliasing n Texture mapping.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 3 Ravi Ramamoorthi
Computer Graphics Mirror and Shadows
Filtering theory: Battling Aliasing with Antialiasing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
CS 431/636 Advanced Rendering Techniques
© 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.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Visual quality techniques.
Antialiasing CAP4730: Computational Structures in Computer Graphics.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
10/26/04© University of Wisconsin, CS559 Fall 2004 Last Time Drawing lines Polygon fill rules Midterm Oct 28.
Filtering Robert Lin April 29, Outline Why filter? Filtering for Graphics Sampling and Reconstruction Convolution The Fourier Transform Overview.
Week 6 - Wednesday.  What did we talk about last time?  Light  Material  Sensors.
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.
Real-Time rendering Chapter 4.Visual Appearance 4.4. Aliasing and antialiasing 4.5. Transparency,alpha,and compositing 4.6. Fog 4.7. Gamma correction
CS418 Computer Graphics John C. Hart
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
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.
Attributes of Graphics Primitives Hearn & Baker Chapter 4 Some slides are taken from Robert Thomsons notes.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
Sampling Theorem & Antialiasing
(c) 2002 University of Wisconsin, CS 559
CS559: Computer Graphics Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008.
1 Dr. Scott Schaefer Antialiasing. 2/70 What is aliasing?
David Luebke 3/17/2016 Advanced Computer Graphics Antialiasing David Luebke
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Antialiasing. What is alias? Alias - A false signal in telecommunication links from beats between signal frequency and sampling frequency (from dictionary.com)
Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
Advanced Computer Graphics
Attributes of Graphics Primitives Hearn & Baker Chapter 4
Image Sampling Moire patterns
Distributed Ray Tracing
Sampling Theorem & Antialiasing
Sampling and Antialiasing
Antialiasing Dr. Scott Schaefer.
Joshua Barczak CMSC435 UMBC
CSCE 643 Computer Vision: Image Sampling and Filtering
UMBC Graphics for Games
Distributed Ray Tracing
Filtering Images Work in the spatial domain
Distributed Ray Tracing
Presentation transcript:

CS 450: COMPUTER GRAPHICS ANTIALIASING SPRING 2015 DR. MICHAEL J. REALE

INTRODUCTION We’re trying to render lines, curves, triangles, or parametric surfaces  continuous (in a mathematical sense) However, we are rendering these objects into a grid of pixels  discrete positions So, our rendering result is from sampling the 2D/3D scene Similar problem with getting values from textures, as we saw earlier

ALIASING: INTUITIVE So far, a pixel would either be “filled” or “not filled” E.g., Bresenham, where we choose one pixel or the other along the line path Lines and edges of polygons have jagged appearance  problem known as aliasing “Jaggies”  jagged edges/lines “Crawlies”  when jagged edges/lines are animated To try to alleviate this, we will use antialiasing approaches

SAMPLING AND FILTERING THEORY

Sampling = getting discrete values from a continuous signal Analogue signal  digital values Aliasing can occur whenever sampling is done Filtering = the process of reconstructing the original signal from samples For simplicity, we’ll focus on 1D uniform sampling

HOW OFTEN SHOULD YOU SAMPLE? Aliasing occurs when sampling at too low a frequency Nyquist rate = twice the maximum frequency of the signal Should sample at MORE than Nyquist rate to ensure you can correctly reconstruct the signal from samples Maximum frequency  implies that signal is bandlimited (meaning that there are no frequencies in the signal above a certain value) Unfortunately, 3D scenes are normally NEVER bandlimited: Polygon edges, shadow boundaries, etc. produce discontinuous changes in signal  frequencies essentially infinite  Some objects small enough to be missed entirely

ALIASING CAUSED BY POOR SAMPLING We can see an example of aliasing caused by poor sampling if we look at a spinning wheel  temporal aliasing Original signal Too few samples  looks like it’s rotating backwards! Exactly two samples per revolution (Nyquist limit)  can’t tell which way it’s rotating More than two samples per revolution  looks correct

ALIASING CAUSED BY POOR SAMPLING Less than Nyquist rate Exactly Nyquist rate

RECONSTRUCTION AND FILTERING Use a filter to reconstruct original signal from bandlimited sampled signal Area of filter should equal one  keeps signal same size Some different kinds of filters: Box filter = nearest neighbor Simple (often used in graphics because of this) Worst filter in terms of quality  makes noncontinuous staircase Tent filter (triangle filter) = linear interpolation of neighboring sample points Reconstruction is at least continuous Sudden slope changes at points Ideal lowpass filter = removes high frequencies (blurs output) Gives perfect reconstruction (if using sinc(f*x), where f = frequency of samples) Filter is infinite on either side (and sometimes negative)  rarely used in practice Gaussian filter Good balance of quality and simplicity

EXAMPLES OF FILTERS Box filter Tent filter sinc() filter

RECONSTRUCTION WITH BOX FILTER

RECONSTRUCTION WITH TENT FILTER

RECONSTRUCTION WITH SINC() FILTER

RESAMPLING Filtering gives you a continuous signal  cannot render that in computer graphics HOWEVER, we can resample reconstructed signal to a new size Resampling = used to magnify or minimize a sampled signal Example: original sample points 1 unit apart; want to resample A units apart: Upsampling  A < 1  more samples (magnification) Downsampling  A > 1  fewer samples (minification)

RESAMPLING: UPSAMPLING Upsampling = magnification Resample reconstructed signal  straightforward Original samples and reconstructed signal Resampled signal  magnification

RESAMPLING: DOWNSAMPLING Downsampling = minification Frequency of original signal too high if using sinc() as recommended before Should use sinc(x/A) to reconstruct signal from samples  ensures more high frequencies removed  then resample Original samples and reconstructed signal with sinc(x) Reconstructed signal with sinc(x/A) followed by resampling  minification

ANTIALIASING APPROACHES

INTRODUCTION There are many different ways to perform antialiasing: Lines Textures (covered this ) Screen output The antialiasing approaches we will cover here are all screen-based solutions: Performed on output samples of pipeline Do NOT need any knowledge of objects being rendered

GENERAL STRATEGY For each screen grid cell, instead of just grabbing one sample, we will: Use more samples per screen grid cell Blend values together in some fashion General strategy of screen-based antialiasing: Use sampling pattern Weight and sum samples to produce pixel color n = # of samples per pixel c(i,x,y) = sample color  samples locations MAY NOT BE THE SAME for each grid cell w i = weight

SAMPLING PATTERNS

SUPERSAMPLING APPROCHES Supersampling (or oversampling) approach = computes more than one full sample per pixel Two supersampling approaches: Full-Scene Antialiasing (FSAA) Accumulation Buffer

FULL-SCENE ANTIALIASING (FSAA) Full-Scene Antialiasing (FSAA) Renders scene at a higher resolution  then averages neighboring samples to create an image Example: original 1000 x 800  render 2000 x 1600 and sample 2x2 area Advantages: Conceptually simple Disadvantages: Costly  rendering MUCH larger image Partial solution: sometimes only double one axis and sample 2x1 or 1x2 Fixed sampling pattern

ACCUMULATION BUFFER Accumulation buffer Uses separate buffer  same size, higher bit depth Render, say, 4 times, shifting each image over by half a pixel in each direction  average results Can also be used for motion blur, depth of field, etc. Advantages: Can have arbitrary sample pattern  each render pass independent (can shift over as we please) Disadvantages: Costly  have to re-render scene 4 times and copy results to screen

MULTISAMPLING APPROACHES Problem with supersampling  each sample has to go through entire pipeline (separate shaders, depths, locations, etc.)  expensive Multisampling approaches Take more than one sample per pixel in single pass Share some computation among passes Examples of multisampling approaches: Multisample antialiasing (MSAA) Coverage sampling antialiasing (CSAA) A-Buffer

MULTISAMPLE ANTIALIASING (MSAA) Multisample antialiasing (MSAA) Saves time by computing fewer shading samples per fragment Example: might have 4 (x,y) sample locations (each with their own color and depth)  shade only computed once per fragment If fragment covers all samples  shading sample at center of pixel If fragment covers some of samples  shading sample can be shifted  centroid sampling or centroid interpolation Done automatically by GPU if enabled, but can return incorrect values 2x MSAA Green  shading sample Red  other samples 4x MSAA 6x MSAA (ATI) 8x MSAA (NVIDIA)

COVERAGE SAMPLING ANTIALIASING (CSAA) Problem with MSAA  mostly unnecessary to store separate color and depth for other samples Coverage sampling antialiasing (CSAA) Just stores coverage of fragment at a higher sampling rate Each subpixel  stores index of fragment associated with it Table with limited number of entries (4 to 8) holds colors and z-depths

A-BUFFER A-Buffer Similar to CSAA  both separate coverage from depth/color storage Commonly used in non-realtime rendering Coverage mask generated for each screen grid cell the polygon covers / partially covers Once all polygons sent to A-Buffer  determine percentage of coverage for each fragment  multiply by fragment’s color Advantages: lower storage requirements (especially compared to FSAA) Disadvantages: no upper limit on number of semi-transparent fragments Coverage mask:

RANDOM SAMPLING Stochastic sampling = random sampling to make sure we don’t miss something really small Example of jittering below

CONCLUSION Nothing in life is perfect, especially not antialiasing That said, MSAA and CSAA offer reasonable tradeoffs between speed and quality