Filtering Approaches for Real-Time Anti-Aliasing

Slides:



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

CRYTEK © 2010 Crytek GmbH BRINGING STEREO TO CONSOLES Nicolas Schulz, R&D Graphics Engineer GDC Europe 2010, AAA Stereo-3D in CryENGINE.
Filtering Approaches for Real-Time Anti-Aliasing
Exploration of advanced lighting and shading techniques
POST-PROCESSING SET09115 Intro Graphics Programming.
Filtering Approaches for Real-Time Anti-Aliasing
An Optimized Soft Shadow Volume Algorithm with Real-Time Performance Ulf Assarsson 1, Michael Dougherty 2, Michael Mounier 2, and Tomas Akenine-Möller.
Filtering Approaches for Real-Time Anti-Aliasing
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Lecture 5 Rendering lines 1.Steps of line rendering 2.Scan-conversion for line segments 3.A1 tutorial CP411 Computer Graphics Fall 2007 Wilfrid Laurier.
Line Drawing Algorithms. Rasterization-Process of determining which pixels give the best approximation to a desired line on the screen. Scan Conversion-Digitizing.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Filtering Approaches for Real-Time Anti-Aliasing
Object Space EWA Surface Splatting: A Hardware Accelerated Approach to High Quality Point Rendering Liu Ren Hanspeter Pfister Matthias Zwicker CMU.
Bump Mapping CSE 781 Roger Crawfis.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
Status – Week 257 Victor Moya. Summary GPU interface. GPU interface. GPU state. GPU state. API/Driver State. API/Driver State. Driver/CPU Proxy. Driver/CPU.
RealityEngine Graphics Kurt Akeley Silicon Graphics Computer Systems.
Soft Particles Petter Börjesson, Mattias Thell. Particle Effects Smoke, fire, explosions, clouds, etc Camera-aligned 2D quads – Gives the illusion of.
Direct Volume Rendering. What is volume rendering? Accumulate information along 1 dimension line through volume.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
I3D Fast Non-Linear Projections using Graphics Hardware Jean-Dominique Gascuel, Nicolas Holzschuch, Gabriel Fournier, Bernard Péroche I3D 2008.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
Shadow Silhouette Maps Pradeep Sen, Mike Cammarano, Pat Hanrahan Stanford University.
Direct Volume Rendering Joe Michael Kniss Scientific Computing and Imaging Institute University of Utah.
Skin Rendering GPU Graphics Gary J. Katz University of Pennsylvania CIS 665 Adapted from David Gosselin’s Power Point and article, Real-time skin rendering,
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges Tomas Akenine-Möller Ulf Assarsson Department of Computer Engineering, Chalmers University.
A Novel 2D To 3D Image Technique Based On Object- Oriented Conversion.
4.2. D EFERRED S HADING Exploration of deferred shading (rendering)
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Aaron Schultz. Idea: Objects close to a light shadow those far away. Anything we can see from the light’s POV is lit. Everything hidden is dark. Distance.
High dynamic range imaging. Camera pipeline 12 bits8 bits.
Queensland University of Technology CRICOS No J INB382/INN382 Real-Time Rendering Techniques Lecture 13: Revision Ross Brown.
CS 638, Fall 2001 Today Light Mapping (Continued) Bump Mapping with Multi-Texturing Multi-Pass Rendering.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Geometric Objects and Transformations. Coordinate systems rial.html.
3/4/04© University of Wisconsin, CS559 Spring 2004 Last Time Clipping Lines –Cohen-Sutherland: The use of outcodes and early reject/accept tests –Liang-Barsky:
1 Rendering Geometry with Relief Textures L.Baboud X.Décoret ARTIS-GRAVIR/IMAG-INRIA.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
Real-time Shadow Mapping. Shadow Mapping Shadow mapping uses two-pass rendering - render depth texture from the light ’ s point-of-view - render from.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Hardware-accelerated Rendering of Antialiased Shadows With Shadow Maps Stefan Brabec and Hans-Peter Seidel Max-Planck-Institut für Informatik Saarbrücken,
Edit this text to create a Heading  This subtitle is 20 points  Bullets are blue  They have 110% line spacing, 2 points before & after  Longer bullets.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Pixmotor: A Pixel Motion Integrator Ivan Neulander Rhythm & Hues.
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
Real-Time Relief Mapping on Arbitrary Polygonal Surfaces Fabio Policarpo Manuel M. Oliveira Joao L. D. Comba.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Real-Time Relief Mapping on Arbitrary Polygonal Surfaces Fabio Policarpo Manuel M. Oliveira Joao L. D. Comba.
Postmortem: Deferred Shading in Tabula Rasa Rusty Koonce NCsoft September 15, 2008.
Real-Time Soft Shadows with Adaptive Light Source Sampling
Combining Edges and Points for Interactive High-Quality Rendering
Graphics Processing Unit
Deferred Lighting.
Chapter 6 GPU, Shaders, and Shading Languages
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
UMBC Graphics for Games
Graphics Processing Unit
UMBC Graphics for Games
UMBC Graphics for Games
Last Time Presentation of your game and idea Environment mapping
Unreal Engine 短期課程 指導老師: 資訊工程系 胡敏君 老師 教育部資通訊軟體創新人才推升推廣計畫
RADEON™ 9700 Architecture and 3D Performance
Frame Buffer Applications
Presentation transcript:

Filtering Approaches for Real-Time Anti-Aliasing

Filtering Approaches for Real-Time Anti-Aliasing Geometry Buffer Anti-Aliasing (GBAA) Emil Persson Avalanche Studios

Basic idea MLAA and friends recover edges from backbuffer (and optionally depth-buffer) Idea: Game engine knows where the edges are. Let’s use that!

First Attempt - GPAA Overdraw edges in final image – Determine major direction (horizontal/vertical) – Compute coverage – Blend with suitable neighbor Optimize with texture filter Pre-process scene geometry – Extract relevant edges

GPAA – Shader // Compute the difference between geometric line and sample position float diff = dot(In.KMF.xy, In.Position.xy) + In.KMF.z; // Compute the coverage of the neighboring surface float coverage = 0.5f - abs(diff); float2 offset = 0; if (coverage > 0) { // Select direction to sample a neighbor pixel float off = (diff >= 0)? 1 : -1; if (asuint(In.KMF.w)) offset.y = off; else offset.x = off; } // Blend pixel with neighbor pixel using texture filtering and shifting the coordinate appropriately. return BackBuffer.Sample(Filter, (In.Position.xy + coverage * offset.xy) * PixelSize);

GPAA - Results

GPAA - Conclusions Very high quality – Very accurate coverage – Excels on near horizontal/vertical case Temporally stable Edge extraction step – Inconvenient – Increased memory consumption Line rasterization – Not ideal for performance – Scaling issues with increasing geometric density

Second Attempt - GBAA Geometry info stored to render-target in main pass – No geometry pre-processing – No line rasterization – Small constant memory addition Fullscreen ”resolve” pass – Fixed cost

GBAA Geometry shader passes down geometry info – Stores distance to edge in the major direction – Use interpolator instead of line equation math Using noperspective keyword Pixel shader selects closest edge

GBAA - Resolve For each pixel, check buffer for intersecting edge – If distance is less than half pixel, we have one. Select neighbor, compute coverage and blend. – Otherwise, leave pixel unchanged.

GBAA - Resolve Problem: Gaps at silhouette edges

GBAA - Resolve Solution – Search immediate neighbors for their closest edge – Use edge matching current pixel, if any. Left:offset.x in [0.5, 1.0] Right:offset.x in [-1.0, -0.5] Up:offset.y in [0.5, 1.0] Down:offset.y in [-1.0, -0.5]

GBAA - Resolve Edges recovered!

GBAA - Shader float2 offset = GeometryBuffer.Sample(Point, In.TexCoord).xy; // Check if edge intersects pixel, otherwise search neighborhood [flatten] if (max(abs(offset.x), abs(offset.y)) > 0.5f) { offset = 0.0f; float2 offset0 = GeometryBuffer.Sample(Point, In.TexCoord, int2(-1, 0)).xy; float2 offset1 = GeometryBuffer.Sample(Point, In.TexCoord, int2( 1, 0)).xy; float2 offset2 = GeometryBuffer.Sample(Point, In.TexCoord, int2( 0, -1)).xy; float2 offset3 = GeometryBuffer.Sample(Point, In.TexCoord, int2( 0, 1)).xy; if (abs(offset0.x f) < 0.25f) offset = offset0.xy + float2(-1, 0); if (abs(offset1.x f) < 0.25f) offset = offset1.xy + float2( 1, 0); if (abs(offset2.y f) < 0.25f) offset = offset2.xy + float2( 0, -1); if (abs(offset3.y f) < 0.25f) offset = offset3.xy + float2( 0, 1); } float2 off = (offset >= float2(0, 0))? float2(0.5f, 0.5f) : float2(-0.5f, -0.5f); offset = offset? off - offset : offset; // Blend pixel with neighbor pixel using texture filtering and shifting the coordinate appropriately. return BackBuffer.Sample(Linear, In.TexCoord + offset.xy * PixelSize);

GBAA – Alpha test GBAA can AA any edge, if distance can be computed/estimated – Alpha-tested edges, estimate with gradients float dx = ddx(alpha); float dy = ddy(alpha); bool major_alpha_dir = abs(dx) > abs(dy); float alpha_dist = -alpha / (major_alpha_dir? dx : dy); – Internal shader edges Parallax Occlusion Mapping

GBAA – Results

GBAA - Performance Resolve pass: GPU: Radeon HD 5870

Future work DX9 / console Internal edges Multiple edges per pixel – Blend with multiple neighbors DX11 with OIT – Blend with background instead of neighbor

Conclusion Very high quality anti-aliasing Low fixed memory cost Cheap resolve pass Varying cost in main rendering Still researching Check for the latest resultswww.humus.name