SIGGRAPH 2010

Содержание

Слайд 2

SIGGRAPH 2010 Dmitry Andreev (AND) dandreev@LucasArts.com Real-time Frame Rate Up-conversion for

SIGGRAPH 2010

Dmitry Andreev (AND)
dandreev@LucasArts.com
Real-time Frame Rate Up-conversion
for Video Games
or how to

get from 30 to 60 fps for “free”
Слайд 3

Agenda Stories, Ideas, Possibilities Excitement, Inspiration Better Games Happy Players …

Agenda

Stories, Ideas, Possibilities
Excitement, Inspiration
Better Games
Happy Players

Technical Details are Simplified
Only current real-time

implementation is discussed
Слайд 4

Real-time DEMO

Real-time
DEMO

Слайд 5

Frame Rate Up-conversion Natural Motion of Objects In Software AVISynth +

Frame Rate Up-conversion

Natural Motion of Objects
In Software
AVISynth + MSU FRC
WinDVD (Trimension)
In

Hardware
Display devices (120Hz HDTVs)
Слайд 6

Motion Estimation Block-matching Diamond Search Optical Flow Phase Correlation MAP/MRF or

Motion Estimation

Block-matching
Diamond Search
Optical Flow
Phase Correlation
MAP/MRF
or take it from the MPEG

stream :)

A

B

Motion Vectors

Слайд 7

Video Frame Interpolation Build Inner frames from outer frames Using Motion

Video Frame Interpolation

Build Inner frames from outer frames
Using Motion Vectors
High-res estimation

is required
Scaling, rotation, transparency, dynamic lighting ???
Слайд 8

Motion Vectors vs Velocities Estimated vs Rendered Motion Vectors Velocity Buffer

Motion Vectors vs Velocities
Estimated vs Rendered
Motion Vectors Velocity Buffer

Слайд 9

No Need for Motion Estimation The Source of Motion is Known

No Need for Motion Estimation

The Source of Motion is Known
Objects
Camera
Handle Special

Cases Differently
Transparency
Shadows, reflections, refractions
Characters ?
Слайд 10

Running at 30 fps Game Extra 16.6 ms More advanced rendering

Running at 30 fps

Game
Extra 16.6 ms
More advanced rendering techniques
Deferred / Screen-space,

etc…
Less strict production process (easier to make)
Слайд 11

Running at 30 fps Game Extra 16.6 ms More advanced rendering

Running at 30 fps

Game
Extra 16.6 ms
More advanced rendering techniques
Deferred / Screen-space,

etc…
Less strict production process (easier to make)
User
Exposed to the same frame Twice
Слайд 12

Motion Eye-tracking (60 fps) Observed @ 60Hz Display A, B, C,

Motion Eye-tracking (60 fps)

Observed @ 60Hz

Display A, B, C, ...
Temporal Functions
Display
Eye

0

1/60

s

0

1/60 s

Слайд 13

Motion Eye-tracking (30 fps) Observed @ 60Hz Display A, A, B,

Motion Eye-tracking (30 fps)

Observed @ 60Hz

Display A, A, B, B, C,

C, ...
Temporal Functions
Display
Eye

0

1/60 s

1/30 s

0

1/60 s

1/30 s

Слайд 14

Motion Blur Helps to Remedy “Flickering”, but… Happens in the Eye…

Motion Blur

Helps to Remedy “Flickering”, but…
Happens in the Eye…
Not the camera

(virtual)
Should not be used at all
At eye-trackable speeds

Observed @ 60Hz

Слайд 15

Motion Blur In Games

Motion Blur In Games

Слайд 16

Слайд 17

The Idea is … Render Velocity Buffer

The Idea is …

Render Velocity Buffer

Слайд 18

The Idea is simple … Render Velocity Buffer Interpolate the Middle Frame

The Idea is simple …

Render Velocity Buffer
Interpolate the Middle Frame

Слайд 19

The Idea is very simple … Render Velocity Buffer Interpolate the

The Idea is very simple …

Render Velocity Buffer
Interpolate the Middle Frame
Present

at the Right Moment in Time

VBlank

VBlank

VBlank

1/60 s

1/60 s

Слайд 20

Ideally (to be “free”) Reuse as Much as Possible Velocity buffers

Ideally (to be “free”)

Reuse as Much as Possible
Velocity buffers
Previous frames @

lower-res
Any other data available (e.g. animations)
No Extra
Latency
Memory / performance hit
Слайд 21

Typical Rendering Pipeline Depth Buffer (~2-3 ms) Shadows, Lighting (deferred), SSAO

Typical Rendering Pipeline

Depth Buffer (~2-3 ms)
Shadows, Lighting (deferred), SSAO
Main Color Pass

& Alpha Pass
Post Effects (HDR, DOF, Motion blur, DLAA, etc...)
Слайд 22

Modified Rendering Pipeline Depth Buffer (~2-3 ms) Render Velocity / Interpolate

Modified Rendering Pipeline

Depth Buffer (~2-3 ms)
Render Velocity / Interpolate / Schedule

to swap
Do the Rest of the Current Frame Pn

GPU is working on

Слайд 23

One-frame Based Solution Pros No extra latency Little extra memory Cons

One-frame Based Solution

Pros
No extra latency
Little extra memory
Cons
Issues with shadows and reflections
Manageable
Harder

to fix interpolation errors
But possible ;)
Слайд 24

INTERPOLATION

INTERPOLATION

Слайд 25

Very Basic Interpolation Pn-½ = f( Pn-1,-½·Vn ) Sample half way backwards Previous frame Pn-1

Very Basic Interpolation

Pn-½ = f( Pn-1,-½·Vn )
Sample half way backwards
Previous

frame Pn-1
Слайд 26

Original I

Original

I

Слайд 27

Interpolated Very basic interpolation II

Interpolated
Very basic interpolation

II

Слайд 28

Very Basic Interpolation III Based on Current Velocity Pn-½ = f(

Very Basic Interpolation III

Based on Current Velocity Pn-½ = f( Pn-1, -½·Vn

)
Sample half way backwards
Previous frame Pn-1
Two Types of Issues
Static geometry tails
Dynamic geometry tails
Слайд 29

Camera Motions (TFU2) I 3rd Person Camera Translation

Camera Motions (TFU2) I

3rd Person Camera

Translation

Слайд 30

Camera Motions (TFU2) II 3rd Person Camera Translation Rotation

Camera Motions (TFU2) II

3rd Person Camera

Translation

Rotation

Слайд 31

Artifact Minimization Static Geometry Velocity buffer filtering Dynamic Geometry (Characters) Render

Artifact Minimization

Static Geometry
Velocity buffer filtering
Dynamic Geometry (Characters)
Render separately, re-render completely or

...
Use Previous Color & Velocity Frames
To fix-up invalid regions
Two-frame solution works best
Слайд 32

Two-frame Based Solution Pros Smoother shadows, alpha, reflections More real data

Two-frame Based Solution

Pros
Smoother shadows, alpha, reflections
More real data to handle overlaps
Cons
Extra

frame of latency
More memory and slower
Слайд 33

Modified Velocity Rendering Re-render Characters At interpolated positions Use other Channels

Modified Velocity Rendering

Re-render Characters
At interpolated positions
Use other Channels
To help with interpolation

and artifact detection
B – 8bit depth buffer
A – 8bit id masks (e.g. characters)
Слайд 34

Velocity Merging Very Simple and Efficient Vmerged = Vn-1 if (

Velocity Merging

Very Simple and Efficient
Vmerged = Vn-1 if ( Zn-1 +

∂ ) < Zn else Vn
Z is embedded in V
Works well for background objects
Assuming continuity of motion
Слайд 35

Original I

Original

I

Слайд 36

Interpolated Velocity Merging II

Interpolated
Velocity Merging

II

Слайд 37

Character Removal I Visual System’s Blind Spot Inspired

Character Removal I

Visual System’s Blind Spot Inspired

Слайд 38

Character Removal I Visual System’s Blind Spot Inspired Synthesize the Interior

Character Removal I

Visual System’s Blind Spot Inspired
Synthesize the Interior
Assuming That
Horizontal remains horizontal
Vertical

remains vertical
Texture is preserved
Shading changes gradually
Слайд 39

Character Removal II Generate Mask

Character Removal II

Generate Mask

Слайд 40

Character Removal II Generate Mask Leak Neighboring Image Patches

Character Removal II

Generate Mask
Leak Neighboring Image Patches

Слайд 41

Character Removal II Generate Mask Leak Neighboring Image Patches Duplicate and offset Up

Character Removal II

Generate Mask
Leak Neighboring Image Patches
Duplicate and offset Up

Слайд 42

Character Removal II Generate Mask Leak Neighboring Image Patches Duplicate and offset Up Down

Character Removal II

Generate Mask
Leak Neighboring Image Patches
Duplicate and offset Up Down

Слайд 43

Character Removal II Generate Mask Leak Neighboring Image Patches Duplicate and offset Up Down Left

Character Removal II

Generate Mask
Leak Neighboring Image Patches
Duplicate and offset Up Down Left

Слайд 44

Character Removal II Generate Mask Leak Neighboring Image Patches Duplicate and

Character Removal II

Generate Mask
Leak Neighboring Image Patches
Duplicate and offset Up Down Left Right
Merge all layers

together
Слайд 45

Character Removal III Repeat N Times Blur the Interior Slightly original

Character Removal III

Repeat N Times
Blur the Interior Slightly

original mask pass

1 pass 2 pass 3 finalize
Слайд 46

Character Removal IV Original Synthesized 3 passes @ 640x360 XBox360 ~

Character Removal IV

Original Synthesized
3 passes
@ 640x360
XBox360 ~ 0.4ms
PS3 ~

0.3ms
(5 SPUs)
Слайд 47

Improved Interpolation Based on Vmerged Sample half way backwards Previous real

Improved Interpolation

Based on Vmerged
Sample half way backwards
Previous real frame Pn-1
Synthesized frame

P'n-1
Based on Masks in Vn and P'n-1
Select P'n-1, if it had a character where Vn does not
Else select Pn-1
Слайд 48

Original I

Original

I

Слайд 49

Interpolated Velocity Merging and Character Removal II

Interpolated
Velocity Merging
and
Character Removal

II

Слайд 50

Next Original In case of One-frame based Interpolation it is Unknown III

Next Original
In case of One-frame based
Interpolation it is Unknown

III

Слайд 51

Typical Flipping Flip Normal Buffer As soon as VBlank is received

Typical Flipping

Flip Normal Buffer
As soon as VBlank is received
Immediately, if VBlank

passed (frame rate drops)
Слайд 52

Modified Flipping Flip Interpolated Frame Based on Time Normal conditions Frame rate drops

Modified Flipping

Flip Interpolated Frame Based on Time
Normal conditions
Frame rate drops

Слайд 53

Custom flipping on XBox360 Bypass Direct3D Present with... Asynchronous Swaps Multiple

Custom flipping on XBox360

Bypass Direct3D Present with...
Asynchronous Swaps
Multiple front buffers
SwapCallback, VerticalBlankCallback
Manual

Hardware Manipulation
D1-GRPH_PRIMARY_SURFACE_ADDRESS 0x7FC86110 (undocumented)
Слайд 54

Real-time Implementation One-frame Based Interpolation of Dynamic Objects Character removal Performance

Real-time Implementation

One-frame Based
Interpolation of Dynamic Objects
Character removal
Performance @ 1280x720
XBox360 ~ 1.5

ms
PS3 (5 SPUs) ~ 1.2 ms
Слайд 55

Motion Blur In TFU2 Current Solution Alpha “friendly”, simple edge condition

Motion Blur In TFU2

Current Solution
Alpha “friendly”, simple edge condition
Better than plain

30 fps
But not as good as 60 fps
Performance @ 1280x720
XBox360 ~ 2.2 ± 0.4 ms (5-11 samples)
PS3 (5 SPUs) ~ 1.4 ± 0.5 ms (16 samples)
Слайд 56

Future Work Transparency Customizations Re-render lightsabers, HUD Multi-layer interpolation Up-scale from

Future Work

Transparency Customizations
Re-render lightsabers, HUD
Multi-layer interpolation
Up-scale from Lower Frame Rates
E.g. render

environment at 20 or 15 fps
Interpolate Shadows and Reflections (or blur)
Predictive Performance Adjustment
Слайд 57

Acknowledgments Szymon Swistun Ruslan Abdikeev Cory Bloyd Cedrick Collomb Axel Wefers

Acknowledgments
Szymon Swistun Ruslan Abdikeev Cory Bloyd Cedrick Collomb Axel Wefers

Слайд 58

Words of Wisdom

Words of Wisdom

Слайд 59

Thank You

Thank You