Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Check out my research I did a few months ago on this topic: <a href="http://www.stevenlu.net/files/motion_blur_2d/Fragment_shader_dynamic_blur.pdf" rel="nofollow noreferrer">http://www.stevenlu.net/files/motion_blur_2d/Fragment_shader_dynamic_blur.pdf</a></p> <p>(update Dec 20, 2014: Now served by my website, which has been reborn in most economical Amazon EC2 form, please don't hit it too hard...)</p> <p><a href="http://www.stevenlu.net/files/motion_blur_2d/60_noblur.gif" rel="nofollow noreferrer">standard rendering of tower smash http://www.stevenlu.net/files/motion_blur_2d/60_noblur.gif</a> <a href="http://www.stevenlu.net/files/motion_blur_2d/60.gif" rel="nofollow noreferrer">blur rendering of tower smash http://www.stevenlu.net/files/motion_blur_2d/60.gif</a></p> <p>Sadly I did not implement textured objects when producing this material, but do use your imagination. I am working on a game engine so when that finally sees the light of day in the form of a game, you can be sure that I'll come and post breadcrumbs here. It primarily addresses how to implement this effect in 2D, and in cases where objects do not overlap. There is not really a good way to handle using a fragment shader to "sweep" samples in order to generate "accurate" blur. While the effect approaches pixel-perfection as the sample count is cranked up, the geometry that must be generated to cover the sweep area has to be manually assembled using some "ugly" techniques.</p> <p>In full 3D it's a rather difficult problem to know which pixels a dynamic object will sweep over during the course of a frame. Even with static geometry and a moving camera the solution proposed by the GPU Gems article is incorrect when moving past things quickly because it is unable to address that issue of requiring blending of the area swept out by something moving...</p> <p>That said, if this approximation which neglects the sweep is sufficient (and it may be) then what you can do to extend to dynamic objects is to take their motion into account. You'll need to work out the details of course but look at lines 2 and 5 in the second code block on the article you linked: They are the current and previous screen space "positions" of the pixel. You simply have to somehow pass in the matrices that will allow you to compute the previous position of each pixel, <strong>taking into account</strong> the dynamic motion of your object. </p> <p>It shouldn't be too bad. In the pass where you render your dynamic object you send in an extra matrix that represents its motion over the last frame.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload