Motionblur

4,383 views
4,168 views

Published on

Motion blur in DX9

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,383
On SlideShare
0
From Embeds
0
Number of Embeds
298
Actions
Shares
0
Downloads
53
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Motionblur

  1. 1. Pixel Motion Blur http://ozlael.egloos.com
  2. 2. 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
  3. 3. Trails behind objects ● Not the same as real motion blur
  4. 4. Radial Blur ● 2D Effect
  5. 5. Depth-Base Velocity depth ● For static mesh velocity
  6. 6. Using Accumulation Buffer ● Large time interval between multiple rend ering
  7. 7. Image space (2.5D) motion blur ● Pixel Process Motion Blur
  8. 8. Pixel Motion Blur ● Works as a Post Process ● Blurs an image of the scene based on obj ect velocities ● Not a physically correct but plausible
  9. 9. Better than Accumulation Buffer
  10. 10. Algorithm ● 1. Render scene to texture - At current time ● 2. Calculate velocity at each pixel - Another Buffer - Calculate current position – previous po sition ● 3. Render motion blurred scene
  11. 11. Velocity
  12. 12. Step 1
  13. 13. Step 2
  14. 14. Step 3
  15. 15. What is the Fault?
  16. 16. What is the Fault?
  17. 17. What are the fault? ● Without knowledge of object edges ● Velocity outside silhouette of object is zer o(= no blur) ● Solution : Geometry distortion
  18. 18. Stretch object geometry
  19. 19. Matthias Wloka's trick
  20. 20. Matthias Wloka's trick ● stretch object geometry between previous and current position ● Compare normal direction with motion ve ctor using dot product ● If normal is pointing in direction of motio n, transform vertex by current transform, else transform it by the previous transfor m ● Not perfect, but it works
  21. 21. Matthias Wloka's trick
  22. 22. Original Image
  23. 23. Stretched Geometry
  24. 24. Velocity Visualization
  25. 25. Motion Blurred Image
  26. 26. Well... Not Perfect ● Not information to avoid occlusion artifact s ● Number of samples needed depends on a mount of motion - 8 samples is good, 16 is better - Ironically, more samples will reduce fra me rate, and therefore increase motion m agnitude
  27. 27. Occlusion fault
  28. 28. Resolve occlusion Color Motion Depth
  29. 29. Iterative sampling ● First pass uses 8 samples ● Ping-pong results ● Second pass uses blurred results, this res ults in 8 * 8 samples (virtually 64) ● 3rd = 512 samples, 4th = 4096, etc
  30. 30. Iterative sampling
  31. 31. Skinning limitation in DX9 ● 256 vertex shader constant registers limit ● Our characters have an average of 54 Mat rix per drawcall ● For motion blur we need previous frame b one(Matrix)s transformations ● If Bone == Quaternion & Tlanslation then must be Uniform Transform ● Or decrease bone count
  32. 32. So....? ● In RS3 for Now ● Using Pixel Motion Blur = Only Object’s Tr ansform ● Animation’s Proceed = Using Accumulatio n Buffer ● Any suggestion?
  33. 33. 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 Tata rchuk, 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, A mitShesh, BaoquanChen ● Motionblur - Myia ● http://incrysis.com/forums/ ● Capcom presentation on Lost Planet

×