Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am working on a game and would like to add motion blur to videos that I export from the engine. Right now, I play back gameplay at 1/16th the original speed, giving me 16x more frames (e.g. instead of 60 frames per second, it's 960 frames per second) and averaging the frames. I am curious though, is this the proper weight or should I give frame samples closer to the middle more alpha? Also, should the frames sampled be sampled uniformly?

share|improve this question
    
Motion around the edges of the screen should blur just like motion in the middle of the screen; uniform sampling from each frame makes sense. Unless you want physically-correct motion blur (which is far from trivial to implement yourself), I would think your approach is good enough. –  namuol May 18 '11 at 21:13
add comment

1 Answer

up vote 1 down vote accepted

You might want to rethink motion blur and only do it for one frame, not blending between several. This will help you avoid a lot of edge cases where your frame rate is stuttering and you have to decide on which frames to blend and how much.

A common way to do this is using motion vectors, where you render your scene again, with extra data for each mesh, and render screen space velocity into a separate buffer. This buffer can then be used as a blur direction control. to compose the final blurred image.

You can also build depth of field information at the same time using this technique.

share|improve this answer
    
I am using a fixed framerate and not in realtime. I am thinking that it will give me a higher quality render. –  echeese May 18 '11 at 6:02
    
Sure it can, but at what cost? If you have the power to jitter everything in time it might be good. Sorry if I did not answer your question. –  void May 18 '11 at 6:09
    
You can probably look at some rayt racing papers for solutions for this. They usually blend jittered images, both in time and space. –  void May 18 '11 at 6:23
    
@void I'm just not sure what weight I give each image or if I just average them. –  echeese May 18 '11 at 6:29
1  
Usually there is no "right" thing. Only what's looking good ;) Do you need physically correct blur? If not then you can probably use some heuristic to blend it. Tried using a bell curve? does it look bad if you just blend everything together with 1/16 the alpha each? –  void May 18 '11 at 6:32
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.