Motion Blur... without shaders

Started by
1 comment, last by Darg 14 years, 1 month ago
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!
Advertisement
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.
Electronic Meteor - My experiences with XNA and game development
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.
Portfolio & Blog:http://scgamedev.tumblr.com/

This topic is closed to new replies.

Advertisement