33
Pixel Motion Blur http://ozlael.egloos.com

Motionblur

Embed Size (px)

DESCRIPTION

Motion blur in DX9

Citation preview

Page 1: Motionblur

Pixel Motion Blur

http://ozlael.egloos.com

Page 2: Motionblur

Motion blur

• What is motion blur?

– Rapidly moving objects appear to be blurred in direction of motion

• What causes motion blur?

– In real cameras, film is exposed to moving scene while shutter is open

• Why do motion blur?

– Adds realism, cinematic look to games

– 24fps with motion blur can look better than 60fps without

Page 3: Motionblur

Trails behind objects

● Not the same as real motion blur

Page 4: Motionblur

Radial Blur

● 2D Effect

Page 5: Motionblur

Depth-Base Velocity

● For static mesh

depth

velocity

Page 6: Motionblur

Using Accumulation Buffer

● Large time interval between multiple rendering

Page 7: Motionblur

Image space (2.5D) motion blur

● Pixel Process Motion Blur

Page 8: Motionblur

Pixel Motion Blur

● Works as a Post Process

● Blurs an image of the scene based on object velocities

● Not a physically correct but plausible

Page 9: Motionblur

Better than Accumulation Buffer

Page 10: Motionblur

Algorithm

● 1. Render scene to texture

- At current time

● 2. Calculate velocity at each pixel

- Another Buffer

- Calculate current position – previous position

● 3. Render motion blurred scene

Page 11: Motionblur

Velocity

Page 12: Motionblur

Step 1

Page 13: Motionblur

Step 2

Page 14: Motionblur

Step 3

Page 15: Motionblur

What is the Fault?

Page 16: Motionblur

What is the Fault?

Page 17: Motionblur

What are the fault?

● Without knowledge of object edges

● Velocity outside silhouette of object is zero(= no blur)

● Solution : Geometry distortion

Page 18: Motionblur

Stretch object geometry

Page 19: Motionblur

Matthias Wloka's trick

Page 20: Motionblur

Matthias Wloka's trick

● stretch object geometry between previous and current position

● Compare normal direction with motion vector using dot product

● If normal is pointing in direction of motion, transform vertex by current transform, else transform it by the previous transform

● Not perfect, but it works

Page 21: Motionblur

Matthias Wloka's trick

Page 22: Motionblur

Original Image

Page 23: Motionblur

Stretched Geometry

Page 24: Motionblur

Velocity Visualization

Page 25: Motionblur

Motion Blurred Image

Page 26: Motionblur

Well... Not Perfect

● Not information to avoid occlusion artifacts

● Number of samples needed depends on amount of motion

- 8 samples is good, 16 is better

- Ironically, more samples will reduce frame rate, and therefore increase motion magnitude

Page 27: Motionblur

Occlusion fault

Page 28: Motionblur

Resolve occlusion

Color Motion

Depth

Page 29: Motionblur

Iterative sampling

● First pass uses 8 samples

● Ping-pong results

● Second pass uses blurred results, this results in 8 * 8 samples (virtually 64)

● 3rd = 512 samples, 4th = 4096, etc

Page 30: Motionblur

Iterative sampling

Page 31: Motionblur

Skinning limitation in DX9

● 256 vertex shader constant registers limit

● Our characters have an average of 54 Matrix per drawcall

● For motion blur we need previous frame bone(Matrix)s transformations

● If Bone == Quaternion & Tlanslation then must be Uniform Transform

● Or decrease bone count

Page 32: Motionblur

So....?

● In RS3 for Now

● Using Pixel Motion Blur = Only Object’s Transform

● Animation’s Proceed = Using Accumulation Buffer

● Any suggestion?

Page 33: Motionblur

Reference● Stupid OpenGL ShaderTricks -Simon Green

● Pixmotor:A Pixel Motion Integrator - Ivan Neulander

● Interactive Real-Time Motion Blur - Matthias M. Wloka & Robert C.Zeleznik

● Motion Blur Using Geometry and Shading Distortion - Natalya Tatarchuk, Chris Brennan, John Isidoro

● Pixel Motion Blur - Direct X SDK

● Motion Blur as a Post-Processing Effect - GPU Gems 3

● CrysisNext Gen Effects -TiagoSousa

● Hardware Accelerated Motion Blur Generation -Clement Shimizu, AmitShesh, BaoquanChen

● Motionblur - Myia

● http://incrysis.com/forums/

● Capcom presentation on Lost Planet