anti aliasing from a different perspective dmitry andreev and dandreev@lucasarts com n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Anti-Aliasing From a Different Perspective Dmitry Andreev (AND) dandreev@LucasArts.com PowerPoint Presentation
Download Presentation
Anti-Aliasing From a Different Perspective Dmitry Andreev (AND) dandreev@LucasArts.com

Loading in 2 Seconds...

play fullscreen
1 / 55

Anti-Aliasing From a Different Perspective Dmitry Andreev (AND) dandreev@LucasArts.com - PowerPoint PPT Presentation


  • 123 Views
  • Uploaded on

Anti-Aliasing From a Different Perspective Dmitry Andreev (AND) dandreev@LucasArts.com. Agenda. Aliasing & Anti-Aliasing Alternative Solutions Exploration DLAA PS3 & X360. The Idea Is . Blur Edges Along Their Directions. Blurred. Done !. Aliasing. Signal Processing

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Anti-Aliasing From a Different Perspective Dmitry Andreev (AND) dandreev@LucasArts.com' - shen


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
anti aliasing from a different perspective dmitry andreev and dandreev@lucasarts com
Anti-Aliasing From a Different Perspective

Dmitry Andreev (AND)

dandreev@LucasArts.com

agenda
Agenda

Aliasing & Anti-Aliasing

Alternative Solutions

Exploration

DLAA

PS3 & X360

the idea is
The Idea Is ...

Blur Edges Along Their Directions

aliasing
Aliasing

Signal Processing

Indistinguishable signals when sampled

Artifact of reconstruction

Graphics

Pixel "noise"

Edge jaggies

anti aliasing i
Anti-Aliasing I

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 aliasing ii
Anti-Aliasing II

Texture

Mip-mapping

Shading

Specular, rim lighting

Avoid manually

Geometry Edges

Multi-sampling (MSAA)

Custom solutions

slide8
MSAA

Good Quality

Partial Super Sampling

At least depth

Deferred Rendering Unfriendly

Costly On Consoles

Directly and indirectly

alternatives
Alternatives

Screen-Space Filtering

Perception based

Hide jaggies

Morphological AA (MLAA)

Temporal (Crysis 2, Halo)

Edge-Based AA

slide10
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
Edge-Based

XBox360 SDK Sample

Render one-pixel wide polygons

Texcoord as pixel coverage

Re-blend neighbors

could not use
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
"Ideal" AA Filter

Multi-Platform

GPU, SPU

Reliable in production

Temporally Stable

Perception Based

Hide jaggies

Good Quality For Low Cost

what if
What If …

Create Pixel Coverage-Like Look

fresnel term based
Fresnel Term Based

(N·V)n

Re-Blend

Curved Surfaces Only

Hard To Control

depth based gradients
Depth Based Gradients

Find Edge Gradients

Depth box-blur

Adjust levels locally

Re-Blend

Flat Surfaces

depth re sampling
Depth Re-Sampling

Render Alternative Depth

Rotated 2nd z-pre pass

Or 4x MSAA for depth

Compute Pixel Coverage

Remap depth value

Re-Blend

observation
Observation

no AA super sampled blurred vertically

dlaa prototyping i
DLAA Prototyping I

Photoshop

Layers vs Pixels

Hard to do complex things

Easy to implement IF works :)

Filter / Other / Custom

Basic 5x5 convolution

Blurs, Edges, etc...

dlaa prototyping ii
DLAA Prototyping II

Blur Vertically

dlaa prototyping iii
DLAA Prototyping III

Blur Vertically

Find Vertical Edges

dlaa prototyping iv
DLAA Prototyping IV

Blur Vertically

Find Vertical Edges

Build Edge Mask

saturate( abs( x ) · a – b )

dlaa prototyping v
DLAA Prototyping V

Blur Vertically

Find Vertical Edges

Build Edge Mask

saturate( abs( x ) · a – b )

Blend With Original Layer

Same Horizontally

two cases
Two Cases

5-Pixel Wide 16-Pixel Wide

long edge detection i
Long Edge Detection I

Take High-Pass Mask

long edge detection ii
Long Edge Detection II

Take High-Pass Mask

Blur

long edge detection iii
Long Edge Detection III

Take High-Pass Mask

Blur

Adjust Contrast

long edge detection iv
Long Edge Detection IV

Take High-Pass Mask

Blur

Adjust Contrast

Apply Long-Edge Filter

Where it's needed

long edge filtering i
Long Edge Filtering I

Color Bleeding

long edge filtering ii
Long Edge Filtering II

Color Bleeding

Luminosity Blending Mode

Blurred luminance As Target

Find local pixel that matches it

noise level estimation
Noise Level Estimation

Exclude Noisy Regions

Have long vertical and horizontal edges

||HhF – VhF|| > λ

VhF

VhF

hF

hF

HhF

HhF

execution results @ 720p
Execution Results @ 720p

XBox360 2.2 ± 0.2 ms

PlayStation3 1.6 ± 0.3 ms (5 SPUs)

Project Time

Research 8 weeks (part time)

X360 2 weeks

PS3 (SPU) > 3 weeks

implementation strategies
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
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 estimation i
Long Edge Estimation I

Find Long Axial Edges Directly

At lower resolution (e.g. from HDR reduction)

long edge estimation ii
Long Edge Estimation II

Interleave 32-bit HDR Input

A part of HDR reduction

Leaves enough edge information

long edge estimation iii
Long Edge Estimation III

Transfer Into Hi-Z (4x4 pixel blocks)

4x MSAA trick

Flip Hi-Z Test With Depth Trick

Using D3DHIZFUNC

mask

dilated Hi-Z

high pass filter
High-Pass Filter

5 Bi-Linear Samples

Around Long Edges Only

Store In Alpha

short edges
Short Edges

Low And High-Pass Filters

Reuse vertical and horizontal samples

Normalized Blending Coefficients

th = ( λ·L( edgeh ) – ɛ) / L( blurh )

L(x) - intensity function

Re-Blend

c = lerp( c, blurh, saturate( th) )

long edges i
Long Edges I

Sparse Sampling On GPU

Reuse short samples

Extra 4 bi-linear samples

Discard If Horizontal And Vertical

[branch] based on blurred high-pass

long edges ii
Long Edges II

Find Local Pixel That Matches Blurred Intensity

blurredlum= lerp( Xlum, Ylum, t )

color = lerp( X, Y, t )

blurredlum

X

Y

long edges iii
Long Edges III

Find Local Pixel That Matches Blurred Intensity

blurredlum= lerp( Xlum, Ylum, t )

color = lerp( X, Y, t)

Two Search Cases

T

C

long edges iv
Long Edges IV

Find Local Pixel That Matches Blurred Intensity

blurredlum= lerp( Xlum, Ylum, t )

color = lerp( X, Y, t)

Two Search Cases

Top and bottom neighbors

Re-Blend

Based on longEdgeMask

T

C

C

B

spu post processing
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 spus i
DLAA On SPUs I

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 + 1 + r )

dlaa on spus ii
DLAA On SPUs II

Quick Luminance

SUMB ( G, R, G, B ) → 0.25R + 0.5G + 0.25B

Quick Saturate

CFLTU x, x, 32; CUFLT x, x, 32

Quick Interpolation

r = lerp( x, y, t )

FS r, Y, X SHUFB X, x, _, _

FMA r, t, r, X SHUFB Y, y, _, _

byte in

byte out

conclusion
Conclusion

DLAA

XBox360 2.2 ± 0.2 ms

PlayStation3 1.6 ± 0.3 ms (5 SPUs)

End Of Console Life Cycle

Every millisecond counts

Tricks are inevitable

Different solutions & different thinking

acknowledgments
Acknowledgments

Szymon SwistunRuslan AbdikeevAxel WefersJerome SchollerTom Madams

Anti-Aliasing Community

thank you
Thank You

Questions ?

dandreev@LucasArts.com