Antialiasing CAP4730: Computational Structures in Computer Graphics.

Slides:



Advertisements
Similar presentations
Sampling, Aliasing.
Advertisements

Sampling and Reconstruction
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.
Computer Graphics Viewing, Rendering, Antialiasing گرد آوري و تاليف: دكتر احمد رضا نقش نيل چي دانشگاه اصفهان گروه مهندسي كامپيوتر.
MIT EECS 6.837, Durand and Cutler Sampling, Aliasing, & Mipmaps.
Computer Graphics Visible Surface Determination. Goal of Visible Surface Determination To draw only the surfaces (triangles) that are visible, given a.
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 Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Compositing and Blending - Chapter 8 modified by Ray Wisman Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Sampling, Aliasing, & Mipmaps
Convolution, Edge Detection, Sampling : Computational Photography Alexei Efros, CMU, Fall 2006 Some slides from Steve Seitz.
Sampling and Pyramids : Rendering and Image Processing Alexei Efros …with lots of slides from Steve Seitz.
Image Sampling Moire patterns
Advanced Computer Graphics (Spring 2006) COMS 4162, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi
1Notes. 2Atop  The simplest (useful) and most common form of compositing: put one image “atop” another  Image 1 (RGB) on top of image 2 (RGB)  For.
CSCE 641 Computer Graphics: Fourier Transform Jinxiang Chai.
CS5520 Image-Based Rendering © Chun-Fa Chang, Spring 2003 Sampling Theorem & Antialiasing April 15, 2003.
1 Computer Science 631 Lecture 3: Morphing, Sampling Ramin Zabih Computer Science Department CORNELL UNIVERSITY.
Lecture 4: Image Resampling CS4670: Computer Vision Noah Snavely.
Lecture 3: Image Resampling CS4670: Computer Vision Noah Snavely Nearest-neighbor interpolation Input image 3x upsample hq3x interpolation (ZSNES)
CPSC 641 Computer Graphics: Fourier Transform Jinxiang Chai.
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
Computational Photography: Fourier Transform Jinxiang Chai.
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Image Sampling Moire patterns -
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
9/20/2001CS 638, Fall 2001 Today Finishing Up Reflections More Multi-Pass Algorithms Shadows.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 3 Ravi Ramamoorthi
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5409 T-R 10:30am – 11:50am.
© 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.
Image Processing 고려대학교 컴퓨터 그래픽스 연구실 cgvr.korea.ac.kr.
Antialiasing CptS 548 Advanced Computer Graphics John C. Hart.
Fundamentals Rawesak Tanawongsuwan
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
Image Synthesis Rabie A. Ramadan, PhD 3. 2 Our Problem.
Image Resampling CS4670: Computer Vision Noah Snavely.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
10/26/04© University of Wisconsin, CS559 Fall 2004 Last Time Drawing lines Polygon fill rules Midterm Oct 28.
Image Resampling CS4670: Computer Vision Noah Snavely.
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 and Sampling
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.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm – 4:20pm.
Texture Mapping CAP4730: Computational Structures in Computer Graphics.
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.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
02/05/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Mach Banding –Humans exaggerate sharp boundaries, but not fuzzy ones.
Sampling Theorem & Antialiasing
CS559: Computer Graphics Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008.
Last Lecture photomatix.com. Today Image Processing: from basic concepts to latest techniques Filtering Edge detection Re-sampling and aliasing Image.
David Luebke 3/17/2016 Advanced Computer Graphics Antialiasing David Luebke
Computer Graphics I, Fall 2008 Compositing and Blending.
Advanced Computer Graphics
Image Resampling & Interpolation
Week 2 - Friday CS361.
Image Sampling Moire patterns
Distributed Ray Tracing
Sampling Theorem & Antialiasing
Sampling and Antialiasing
Fundamentals Data.
Image Sampling Moire patterns
CSCE 643 Computer Vision: Thinking in Frequency
UMBC Graphics for Games
Filtering Part 2: Image Sampling
Image Sampling Moire patterns
Image Resampling & Interpolation
Presentation transcript:

Antialiasing CAP4730: Computational Structures in Computer Graphics

Outline n What is antialiasing? n How do we see the affects of antialiasing? n What can we do about it? n Math behind antialiasing n Antialiasing in modern day graphics cards n Advanced stuff on AA

Let’s Revisit a pixel n A pixel is which of these things (theoretically)? –point –circle/disk –square/rectangle –has area –has a location –sample

White Picket Fence n What happens when we back away? –1: with a camera /eye –2: with OpenGL –3: with ray- tracing n What’s the cause of the difference? n A pixel could be too BIG!

A New Thought about Images n Images are really a 2D function n Here’s an image plotted as a height field n Now we store this image as an “array” of points. What does that mean?

We Sample the Image Function n Here is the sampling function. It is called the delta function

Thus we are “sampling” a continuous image function n We call these samples at this regular grid of points, pixels. n Pixels are a sampling of the function that describes the image. n We store these pixels into memory as an array of colors. n How densely should we sample? n What would govern this?

Samples n Continuous - function with values at any input. Most things in the world. Ex. sine and cosine n Discrete - function with values only at specific inputs. Computers are discrete. n What is a 1D example? a 2D example? n To convert from a continuous function to a discrete one, we discretize or sample n To convert form a continuous variable to a discrete one, we quantize n When we render an image (which is a continuous function, why?), we sample and quantize

Let’s get grounded with an example

Similar examples? n High frequency information, low sampling. –Examples? n Train comes every 2 hours. You go every 2:15. How long do you wait? n Audio. 44/48 Khz signal. 11 Khz Sample –What is the result? –Images n 8 MP vs 4 MP vs 640 x 480

A quick footnote into frequency analysis n A way to understand the sampling question is to convert the function into a different “space” or domain. n We use the Fourier Transform to convert the function (in our case the image) into the frequency domain.

What does sampling mean? n What happens if we don’t sample enough?

Aliasing n If we sample at too low a rate, the high frequencies in the image appear as lower frequencies. n How do we fix it? n Increase sampling n Remove high frequencies

Aliasing Manifestations n Pixels approximating a signal n Pixels aren’t small enough and MISS information

Aliasing n Aliasing manifests itself as “jaggies” in graphics. Thus we don’t have enough pixels to accurately represent the underlying function. Check out what happens when we increase our sampling.

Aliasing n Aliasing also manifests itself in repeating patterns n Car wheels n Big picture: –Continuous signal –Discrete sampling (pixels, frames, etc.) –Aliasing represents misrepresentation (hence the name) involved n How do we fix it?

Fixing Aliasing n Increase Resolution n What’s wrong with this approach? n Filtering is another possibility –We want to remove the high frequency areas –How would we do that? n Let’s re-examine what a pixel is in reality.

Pixels are points n But when we display the points, what happens? n Each pixel is actually a “blob” on the CRT. This blob has energy that falls off close to a Gaussian. n Thus the CRT has a built in “blurring” system. Think about how this works with resolution of your monitor.

(0,0) (4,2) (4,0) Let’s recall

Point Sampling n Thus for each pixel, we are “sampling” a specific point. In the frequency domain we get: n To convert from frequency to spatial domains, we do an integration. n To get around point sampling we should come up with another sampling technique

BiLinear Sampling n What we will do is use a bilinear filter. n This reduces the high frequencies (which cause aliasing) n Interpolate between samples.

BiLinear Sampling

What are we doing? (0,0) (4,2) (4,0)

Blurring n Remember, blurring removes high frequencies, which cause aliasing. n We can do other filtering besides bilinear, and we would like to to avoid artifacts. n 11/Slide27.html n How would we blur using our traditional graphics pipeline?

Two ways to Antialias n Increase resolution (increase sampling) –or n Supersampling

Increase Rendering Resolution n Render the image at a higher resolution and downsample. n Really, you are letting your eye do some filtering for you.

Supersampling n For each pixel, we would like to figure out what “percentage” is covered. (0,0) (4,0)

Supersampling n For each pixel, sample at multiple points. –What is the distribution of these points? n Uniform Grid n Random n Psuedo-random n How many? n How far away from center should I try? –How would I program this?

Line Antialiasing

Full Screen Antialiasing n Another way to do the supersampling is to do full screen antialiasing n We want to draw the image with several camera jitter positions and average the answers n Can you see why this would give us near similar answers? n That’s what they mean by 2-tap, 4-tap antialiasing n What does this require? –Memory-wise –Computation-wise n How would you implement this?

Full Screen Antialiasing Example (Exaggerated)

Antialiasing in OpenGL n To do this in OpenGL, use the Accumulation buffer –glAccum(GL_ACCUM, FRAMES_TO_AVERAGE); –glAccum(GL_LOAD, 1); –glAccum(GL_RETURN); n VERY SLOW! What does this mean memory wise? n Other approahces: graphics cards, quincux

Aliasing Examples n From: e.com/v1n7/colorwk s.html

Hardware Antialiasing n Don’t just generate 1 answer to write to a pixel n nVidia Quincunx AA (2000 – GeForce3) n Result

Results from i-aa/index.x?pg=4

Difference

OpenGL Antialiasing n Points and Lines –glEnable(GL_POINT_SMOOTH); –glEnable(GL_LINE_SMOOTH); n Triangles –glEnable(GL_POLYGON_SMOOTH); n Provides blend alpha at edges of a triangle