Skip to main content
gamedev.net
🔒 Locked

Motion blur....

Started by Soul 4 replies 1.2k views
Original Post
Soul
Soul
Hi Guys, I''m farily new to directX, but I''ve been a c++ programmer for around 8 years, I need pointing in the direction of some information on how to implement motion blur in a 3D environment, prefereably using DX, but just the principles of motion blur will do Thanks in advance Soul.
Sneftel
Sneftel
The general case of motion blur is an extremely difficult one to handle in realtime. What is your specific application? Any "special circumstances" are candidates for exploiting in making an efficient motion blur effect.
Soul
Soul
Ok basically, to get the hang of things, I''m writing a 3D space invaders kind of app, so the player is basically the camera, and loads of object flying around to shoot at, however I get a "jitter" when rotating the camera some times, I heard that motion blur is the way to sort this out?

hope this helps
MSW
MSW
The simplest way is to render multiple frames and average them togther at the pixel level....but this is very slow...especialy considering that the faster things move...the more frames need to be rendered to smooth things out (else it looks like there are "ghosts" and other image artifacts as the blurs will not be smooth).

You can sorta cheat buy "adding" each frame with something like a pixel shader....to do this you would basicly have to reduce the brightness of your textures by a percentage basied on how many "blur frames" you will be rendering....for example lets say you will render 5 frames...so the brightness of the textures should be reduced to 20%...clear the backbuffer and z-buffer...render frame 1...but add the (reduced brightness) polygon''s pixel color to the background instead of setting it out right...once done...clear the Z-buffer (but not the backbuffer)...move everything for the next inbetween frame...and render again (adding polygon pixel color values to screen pixel color values)...once you go through all the frames, swap it onto the screen....

Another way (this is a real cheat...but fairly fast...and the most commonly used one)...is to store several copies of each regular game frame and alpha blend them together....for example...you are rendering to backbuffer01....once done....you then blit (useing some even alpha blending value) backbuffer02 onto backbuffer01...backbuffer01 then gets booted on screen....then you clear buff02 and render to it...then alpha blit buff01 back onto buff02 before showing it onscreen....

Soul
Soul
Sounds good, I''ll give it a go
Thanks for the help guys
Soul.
Venerable
Venerable
On the Nvidia site:

http://developer.nvidia.com/view.asp?IO=motion_blur

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.