Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Motion Blur ???

This topic is 6248 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anybody can explane how make motion blur effect I will be happy some link to examples on opengl or d3d Thanks

Share this post

Link to post
Share on other sites
Hmm just some brief info on this.
In openGL the ''proper'' way to apply motion blur to a scene is through use of the accumulation buffer, this is rarely supported in hardware so is painfully slow. I think voodoo 4/5 have one and some really high end cards.
But if you have say just particles moving on a black background, you can fake it by simply drawing a frame, then when you draw the next one, dont clear the colour buffer, then blend a black quad over the screen instead, then redraw the updated scene on top.
There are many ways to fake it but most seem to look not too nice or be to slow. Look around I''m sure you''ll find something cool in openGl, Direct3d or software.
I''m sure people here will know more than me.
Hope this brief post has been of some use.

Share this post

Link to post
Share on other sites
It's actually a pretty easy effect to implement, it's just that you don't want to do it too much or you'll kill your fillrate. Basically, with the object in question, you redraw it multiple times slightly behind the actual position of the object. So, quasipseudocode would look like so:

//Create a vector that goes the opposite direction as the player

Vector InvObjectPosition=MyObjectPosition();
InvObjectPosition *= -1;

//Loop through and draw the object multiple times. We're

//just going to cheat and use the integer length of the vector

//to determine how many blurred objects we'll have. There's

//probably a "real" way to do this that you might want to look

//up, but this is sufficient for our purposes.

float Alpha=1.0f; //Alpha, continually subtract from this number

Vector ObjectDirection; //Same as InvObjectPosition, but length

//of 1.

ObjectDirection = InvObjectPostion;

for(int i=0; i<InvObjectPosition.Length(); i++)
//Move it back along the vector based on the value of i

Position BlurredObjectPosition = MyObjectPosition();
BlurredObjectPosition += (ObjectDirection * i);

//Render the object again with other positions

RenderObject(Alpha, BlurredObjectPosition);

//Calculate a new Alpha value

Alpha = 1-(i/InvObjectPosition.Length());

That's sort of cheap, but it's a starting point at least . It doesn't handle animation, and you'll need to figure out what blending states work best, but that hopefully helps a bit.

Edited by - The Senshi on June 7, 2001 1:14:27 PM

Share this post

Link to post
Share on other sites
Guest Anonymous Poster

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!