1 / 31

Pixels are for Chumps Anti-Aliasing

Pixels are for Chumps Anti-Aliasing. CSE3AGR 2009 Paul Taylor. What is AA. Anti Aliasing is the process of avoiding Aliasing. http://upload.wikimedia.org/wikipedia/commons/f/fd/Anti-aliased-diamonds.png. I can’t upscale this otherwise PowerPoint does some anti-aliasing of it!.

fauve
Download Presentation

Pixels are for Chumps Anti-Aliasing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pixels are for ChumpsAnti-Aliasing CSE3AGR 2009 Paul Taylor

  2. What is AA • Anti Aliasing is the process of avoiding Aliasing

  3. http://upload.wikimedia.org/wikipedia/commons/f/fd/Anti-aliased-diamonds.pnghttp://upload.wikimedia.org/wikipedia/commons/f/fd/Anti-aliased-diamonds.png I can’t upscale this otherwise PowerPoint does some anti-aliasing of it!

  4. So what is Aliasing? • An Alias is another name for something. • A person with 3 names would have a real name and 2 aliases • Aliasing is an effect which causes different levels of a signal to become indistinguishable (or aliases of each other) • In this picture a sloped line is aliased into a stairway http://www.gemaga.com/2007/12/28/taking-old-games-into-the-hd-era

  5. How does AA work? • We are stuck with a finite resolution • No more pixels to be found! • Basically we need to modify the way in which the data is represented on our screen to reduce the effect of Aliasing • This is done by blurring the aliased areas of the screen.

  6. Blurring is kind of the wrong word, it’s more like multi-sampling the data. • This is done when up-scaling images a lot as the up-scaled image can have some huge pixels! • We take more than one render of the image at slight (sub-pixel) offsets and try to accumulate the average of each pixel. • Through this process, Solid pixels will remain solid • Pixels on the Verge (Precipice) will mix slightly with their neighbours • The degree they mix is controlled by how close the Verge is to the pixel boundary

  7. Jitter 1

  8. Jitter 2

  9. Jitter 3

  10. Jitter 4

  11. Jitter 16

  12. A pretty Triangle http://nittech.blogspot.com/2007/05/anti-aliasing-filter-and-anisotropic.html

  13. A pretty Triangle Rendered http://nittech.blogspot.com/2007/05/anti-aliasing-filter-and-anisotropic.html

  14. A pretty Triangle Rendered with AA http://nittech.blogspot.com/2007/05/anti-aliasing-filter-and-anisotropic.html

  15. A pretty Triangle Made Small http://nittech.blogspot.com/2007/05/anti-aliasing-filter-and-anisotropic.html

  16. A pretty Triangle Rendered http://nittech.blogspot.com/2007/05/anti-aliasing-filter-and-anisotropic.html

  17. A pretty Triangle Rendered with AA http://nittech.blogspot.com/2007/05/anti-aliasing-filter-and-anisotropic.html

  18. Antialiasing Storage • The Accumulation Buffer is where we store the image http://www.meko.co.uk/glossaryimages/antialiasing.gif

  19. Accumulation Buffer Storage • glClear(GL_ACCUM_BUFFER_BIT); \\ Clear the buffer glAccum(GL_ACCUM, 1.f / aaPasses); GL_ADD – Adds RGBA to the Accumulation Buffer GL_MULT – Multiplies each RGBA in the Acc buffer by the given Value GL_ACCUM – Adds (ReadBuffer / 2n-1 ) * Value GL_RETURN – Returns the values of the Acc buffer to the display buffer (* 2n-1 ) * value * N = Number of bits per component in selected display buffer

  20. http://nittech.blogspot.com/2007/05/anti-aliasing-filter-and-anisotropic.htmlhttp://nittech.blogspot.com/2007/05/anti-aliasing-filter-and-anisotropic.html

  21. http://www.math.ucsd.edu/~sbuss/CourseWeb/Math155B_2004Winter/FinalProjects/chu_tak_sun/antialiasing.JPGhttp://www.math.ucsd.edu/~sbuss/CourseWeb/Math155B_2004Winter/FinalProjects/chu_tak_sun/antialiasing.JPG • http://www.schorsch.com/kbase/glossary/aliasing.html

  22. What about Textures? • Nearest Neighbour • Bilinear Filtering • Bicubic Filtering • Trilinear • This is Bilinear Filtering done with an interpolation between Mip-Maps • Anisotrpoic (AF) • More complex and Better at retaining detail at extreme angles http://en.wikipedia.org/wiki/File:Image-resample-sample.png

  23. http://en.wikipedia.org/wiki/File:Nearest2DInterpolExample.pnghttp://en.wikipedia.org/wiki/File:Nearest2DInterpolExample.png Nearest Neighbour

  24. http://en.wikipedia.org/wiki/File:BilinearInterpolExample.pnghttp://en.wikipedia.org/wiki/File:BilinearInterpolExample.png Bilinear

  25. http://en.wikipedia.org/wiki/File:BicubicInterpolationExample.pnghttp://en.wikipedia.org/wiki/File:BicubicInterpolationExample.png BiCubic

  26. Trilinear http://en.wikipedia.org/wiki/File:Anisotropic_compare.png

  27. Nice Clean AA • You must alter the ModelView Matrix and the Projection Matrix

  28. Altering the Projection Matrix • Some AA can be done by altering the frustum slightly. It’s not the best approach as the closer the polygon the more effect the frustum has

  29. Advanced AA • Dirty AA • By just moving the Projection Matrix you can get a quick and dirty version of AA running. • The lighting is not affected by moving your Projection Matrix • You WILL create artefacts • They MAY be visible!

  30. Depth of Field • Performing AA with a Focal Point • Much like the first altering the projection matrix, but should still be done in the ModelView Matrix!!!!

  31. Hardware Support ARB_MULTISAMPLE – This does FSAA for you Lookup NeHe OpenGL Lesson 46 - FullscreenAntiAliasing http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=46

More Related