Sign in to follow this  
Tipotas688

Motion Blur... without shaders

Recommended Posts

I have implemented a very nice algorithm in XNA that blurs the back buffer with the front buffer creating a motion blur effect. Now I want to do that in D3D and C++ but since I m not using any shaders I m having some trouble managing it. I am using the DXUT package but in their examples they use shaders whilst I am using ID3DXSprite to draw my sprites. Is there any procedure to save the previous frames and blend them using alpha blending with the current one to create the motion blur? Regards!

Share this post


Link to post
Share on other sites
You could store multiple render targets and cycle through them on each frame and keep writing over the oldest one as you go. It's definitely not going to achieve the best effect (you are not going to blur adjacent pixels which simulates a swept volume effect), but it is a very approachable solution if you use a reasonable amount of render targets.

The biggest cost will probably be the memory to store the render target surfaces. Draw and blend the targets (you could use sprites for this as well), for example, using an additive blend and reducing the color values by a factor based on the number of frames you blend.

Share this post


Link to post
Share on other sites
I created a very simple motion blur by keeping a texture of the previous frame then drawing the new frame onto it with say a 75% opacity. You then save the current frame as the previous frame texture.

This means that previous frames seem to fade away. This looks good at high framerates 30-60fps but pretty bad when you get down below 30fps. You really don't want to be getting down under 30 anyway.

It's cheap and does the job quite well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this