Anti-Aliasing From a Different Perspective Dmitry Andreev (AND)

Slides:



Advertisements
Similar presentations
Destruction Masking in Frostbite 2 using Volume Distance Fields
Advertisements

Filtering Approaches for Real-Time Anti-Aliasing
Exploration of advanced lighting and shading techniques
SIGGRAPH 2010 Dmitry Andreev (AND) Real-time Frame Rate Up-conversion for Video Games or how to get from 30 to 60 fps for “free”
Compositing and Blending Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics.
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Parallax-Interpolated Shadow Map Occlusion
RealityEngine Graphics Kurt Akeley Silicon Graphics Computer Systems.
Filtering Approaches for Real-Time Anti-Aliasing
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Advanced Rendering MATERIALS, POSTEFFECTS AND SCENE COMPOSITION GDC
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Realism in Computer Graphics K. H. Ko School of Mechatronics Gwangju.
Compositing and Blending Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Image Compositing Angel 8.11 Angel: Interactive Computer Graphics5E © Addison-Wesley
Fast GPU Histogram Analysis for Scene Post- Processing Andy Luedke Halo Development Team Microsoft Game Studios.
IN4151 Introduction 3D graphics 1 Introduction 3D Computer Graphics part 1 Projective display Viewing pipeline Graphics hardware Image-based rendering.
(conventional Cartesian reference system)
X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that.
Admission to CS 184 Enrollment priorities are 1. CS/EECS majors, 2. CS/EECS minors (this category includes applied math majors) 3. anyone else with a declared.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Copyright  Philipp Slusallek IBR: View Interpolation Philipp Slusallek.
Multisample Antialiasing Kurt Akeley CS248 Lecture 6 11 October 2007
Post-rendering Cel Shading & Bloom Effect
Filtering Approaches for Real-Time Anti-Aliasing /
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.
Neighborhood Operations
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
Ray Tracing and Photon Mapping on GPUs Tim PurcellStanford / NVIDIA.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
1 Texture Mapping ©Anthony Steed Overview n Texture mapping Inverse and Forward Mapping Bilinear interpolation Perspective correction n Mipmapping.
Lecture 3 : Direct Volume Rendering Bong-Soo Sohn School of Computer Science and Engineering Chung-Ang University Acknowledgement : Han-Wei Shen Lecture.
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.
Mesh Color Cem Yuksel John Keyser Donald H. House Texas A&M University SIGGRAPH /12/06 Xiang.
Interactive Time-Dependent Tone Mapping Using Programmable Graphics Hardware Nolan GoodnightGreg HumphreysCliff WoolleyRui Wang University of Virginia.
High-Resolution Interactive Panoramas with MPEG-4 발표자 : 김영백 임베디드시스템연구실.
Filtering Approaches for Real-Time Anti-Aliasing
CS 450: COMPUTER GRAPHICS ANTIALIASING SPRING 2015 DR. MICHAEL J. REALE.
Week 6 - Wednesday.  What did we talk about last time?  Light  Material  Sensors.
Fast Cascade VSM By Zhang Jian.
Stream Processing Main References: “Comparing Reyes and OpenGL on a Stream Architecture”, 2002 “Polygon Rendering on a Stream Architecture”, 2000 Department.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Real-time Shading with Filtered Importance Sampling Jaroslav Křivánek Czech Technical University in Prague Mark Colbert University of Central Florida.
1 Texture Mapping. 2 Texture Aliasing MIPmaps Environment Mapping Bump Mapping Displacement Mapping Shadow Maps Solid Textures Antialiasing.
Tone Mapping on GPUs Cliff Woolley University of Virginia Slides courtesy Nolan Goodnight.
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
Xbox MB system memory IBM 3-way symmetric core processor ATI GPU with embedded EDRAM 12x DVD Optional Hard disk.
Efficient Streaming of 3D Scenes with Complex Geometry and Complex Lighting Romain Pacanowski and M. Raynaud X. Granier P. Reuter C. Schlick P. Poulin.
Stencil Routed A-Buffer
Maths & Technologies for Games Advanced Graphics: Scene Post-Processing CO3303 Week
Single Pass Point Rendering and Transparent Shading Paper by Yanci Zhang and Renato Pajarola Presentation by Harmen de Weerd and Hedde Bosman.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
Digital Image Processing CSC331
Computer Graphics I, Fall 2008 Compositing and Blending.
Applications and Rendering pipeline
Antialiasing. What is alias? Alias - A false signal in telecommunication links from beats between signal frequency and sampling frequency (from dictionary.com)
Week 7 - Monday CS361.
Combining Edges and Points for Interactive High-Quality Rendering
Deferred Lighting.
3D Graphics Rendering PPT By Ricardo Veguilla.
Sampling Theorem & Antialiasing
Sampling and Antialiasing
The Graphics Rendering Pipeline
UMBC Graphics for Games
RADEON™ 9700 Architecture and 3D Performance
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

Anti-Aliasing From a Different Perspective Dmitry Andreev (AND)

Directionally Localized Anti-Aliasing

Agenda  Aliasing & Anti-Aliasing  Alternative Solutions  Exploration  DLAA  PS3 & X360

The Idea Is... Blur Edges Along Their Directions

Blurred. Done !

Aliasing  Signal Processing Indistinguishable signals when sampled Artifact of reconstruction  Graphics Pixel "noise" Edge jaggies

Anti-AliasingI  Reduce Higher-Frequencies  Oversample And "Blur" Temporal in audio Spatial in optics  No Perfect Filter Exists Sampling theory Sharp (aliased) vs soft (anti-aliased)

Anti-AliasingII  Texture Mip-mapping  Shading Specular, rim lighting Avoid manually  Geometry Edges Multi-sampling (MSAA) Custom solutions

MSAA  Good Quality  Partial Super Sampling At least depth  Deferred Rendering Unfriendly  Costly On Consoles Directly and indirectly

Alternatives  Screen-Space Filtering Perception based Hide jaggies Morphological AA (MLAA)  Temporal (Crysis 2, Halo)  Edge-Based AA

MLAA  Morphological Anti-Aliasing (Intel) Reconstruct original geometry Re-blend neighbors  CPU Friendly The Saboteur GoW3 (4ms / 5 SPUs)  XBox360 GPU (> 3.7 ms)

Edge-Based  XBox360 SDK Sample Render one-pixel wide polygons Texcoord as pixel coverage Re-blend neighbors

Could Not Use  MLAA Unstable Tough on X360  Edge-Based Extra GPU cost on PS3  Temporal Dynamic resolution adjustment in TFU2 Motion vs resolution

"Ideal" AA Filter  Multi-Platform GPU, SPU Reliable in production  Temporally Stable  Perception Based Hide jaggies  Good Quality For Low Cost

What If … Create Pixel Coverage-Like Look

Fresnel Term Based  ( N·V ) n  Re-Blend  Curved Surfaces Only  Hard To Control

Depth Based Gradients  Find Edge Gradients Depth box-blur Adjust levels locally  Re-Blend  Flat Surfaces

Depth Re-Sampling  Render Alternative Depth Rotated 2 nd z-pre pass Or 4x MSAA for depth  Compute Pixel Coverage Remap depth value  Re-Blend

Observation no AA super sampled blurred vertically

DLAA PrototypingI  Photoshop Layers vs Pixels Hard to do complex things Easy to implement IF works :)  Filter / Other / Custom Basic 5x5 convolution Blurs, Edges, etc...

DLAA PrototypingII  Blur Vertically

DLAA PrototypingIII  Blur Vertically  Find Vertical Edges 2

DLAA PrototypingIV  Blur Vertically  Find Vertical Edges  Build Edge Mask saturate( abs( x ) · a – b )

DLAA PrototypingV  Blur Vertically  Find Vertical Edges  Build Edge Mask saturate( abs( x ) · a – b )  Blend With Original Layer  Same Horizontally

Short Edges Only

Two Cases 5-Pixel Wide 16-Pixel Wide

Long Edge DetectionI  Take High-Pass Mask

Long Edge DetectionII  Take High-Pass Mask  Blur

Long Edge DetectionIII  Take High-Pass Mask  Blur  Adjust Contrast

Long Edge DetectionIV  Take High-Pass Mask  Blur  Adjust Contrast  Apply Long-Edge Filter Where it's needed

Long Edge FilteringI  Color Bleeding

Long Edge FilteringII  Color Bleeding  Luminosity Blending Mode  Blurred luminance As Target Find local pixel that matches it

Noise Level Estimation  Exclude Noisy Regions Have long vertical and horizontal edges ||H hF – V hF || > λ V hF hF H hF

Gradient Levels Comparison no AAMLAADLAA

Visual Results

Reflections Anti-Aliasing

Execution 720p  XBox ± 0.2 ms  PlayStation31.6 ± 0.3 ms (5 SPUs)  Project Time Research8 weeks (part time) X3602 weeks PS3 (SPU)> 3 weeks

Implementation Strategies  Execution Time Reuse samples Reject as much work as possible Balance pipelines  Memory Usage Reuse textures and buffers Pack data by usage  Global Pipeline Optimizations

Work Rejection  Pre-Process Find long edge regions High-pass around long edges Resolve  Process Short edges Short and long edges (~10-20 %) Resolve

Long Edge EstimationI  Find Long Axial Edges Directly At lower resolution (e.g. from HDR reduction)

Long Edge EstimationII  Transfer Into Hi-Z (4x4 pixel blocks) 4x MSAA trick  Flip Hi-Z Test With Depth Trick Using D3DHIZFUNC maskdilated Hi-Z

High-Pass Filter  5 Bi-Linear Samples  Around Long Edges Only  Store In Alpha

Short Edges  Low And High-Pass Filters Reuse vertical and horizontal samples  Normalized Blending Coefficients t h = ( λ·L( edge h ) – ɛ ) / L( blur h ) L(x) - intensity function  Re-Blend c = lerp( c, blur h, saturate( t h ) ) v0v0 v1v1 h0h0 h1h1 Ch2h2 h3h3 v2v2 v3v3

Long EdgesI  Sparse Sampling On GPU Reuse short samples Extra 4 bi-linear samples  Discard If Horizontal And Vertical [branch] based on blurred high-pass -8 C 8

Long EdgesII  Find Local Pixel That Matches Blurred Intensity blurred lum = lerp( X lum, Y lum, t ) color = lerp( X, Y, t ) X Y blurred lum

Long EdgesIII  Find Local Pixel That Matches Blurred Intensity blurred lum = lerp( X lum, Y lum, t ) color = lerp( X, Y, t )  Two Search Cases T C

Long EdgesIV  Find Local Pixel That Matches Blurred Intensity blurred lum = lerp( X lum, Y lum, t ) color = lerp( X, Y, t )  Two Search Cases Top and bottom neighbors  Re-Blend Based on longEdgeMask T C C B

Typical SPU Code

SPU Post Processing  Software Pipelining Hide latency  Balance Even And Odd Instructions  Stream Processing  Tiled RSX Surfaces 0.3 ms to copy from VRAM Partial untiling with DMA

DLAA On SPUsI  No Need to Handle Overlaps  Short Edges Byte operations → 4 RGBA pixels / clk (1 2 1) = AVGB( AVGB( l, c ), AVGB( c, r ) ) ║x – y║ = ABSDB( x, y )  Long Edges blur( x ) = ∑f(x + dx) blur( x + 1 ) = blur( x ) – f( x – r ) + f( x r )

DLAA On SPUsII  Quick Luminance SUMB ( G, R, G, B ) → 0.25 R G B  Quick Saturate CFLTU x, x, 32; CUFLT x, x, 32  Quick Interpolation r = lerp( x, y, t ) FS r, Y, XSHUFB X, x, _, _ FMA r, t, r, XSHUFB Y, y, _, _ 3F80…00 byte inbyte out

Typical SPU Code

Efficient SPU Code

Conclusion  DLAA XBox ± 0.2 ms PlayStation31.6 ± 0.3 ms (5 SPUs)  End Of Console Life Cycle Every millisecond counts Tricks are inevitable Different solutions & different thinking

Acknowledgments Szymon Swistun Ruslan Abdikeev Axel Wefers Jerome Scholler Tom Madams Anti-Aliasing Community

Thank You

Questions ?