Motion blur - the blitz way?

Blitz3D Forums/Blitz3D Beginners Area/Motion blur - the blitz way?

Gamzman(Posted 2006) [#1]
Hi, I'm a former DBP user and I have decided to now use Blitz3D to fullfill my needs (I was just P***ed off with all the bugs & lack of support).

Anyway, I've been looking through the codebase and have downloaded all the motion blur source codes, which are very good! Heres the thing I want to be able to code/understand it myself but I don't understand the technique being used, please could someone explain (in detail) how to code this effect.

I'm not asking for source code but more of explaination of what is going on, I know sprites are used but I'm not sure what/and how they are creating the effect.

Thank you, and I'm glad to an offical blitz user (bought it yesterday and well worth the £60 it cost me!)

Kind Regards,
Gamzman


IKG(Posted 2006) [#2]
It's almost like the sprite is everything you see, only a few inches to the side so that your vision is partly blurred. I may be wrong, but I'm just guessing...


Gamzman(Posted 2006) [#3]
I really don't want to sound ungreatful but that doesn't really help me.

I appreciate any further information anyone can give me :)


jfk EO-11110(Posted 2006) [#4]
I think the motion blur from the archives is more an alpha delay (or more precisely: alpha reverb). This is looking like motion blur in certain situations. Imagine you'll move the current render to a sprite that covers the screen and is set to say 0.2 transparency. So with the next render you'll have the current state in 0.8 alpha presence, the previous render about 0.18, the one before 0.018, etc.

A real motion blur looks much better IMHO, but also requires a fast machine and very quick rendering of the scene. Imagine your game runs with 300 fps. now simply don't show each of them onscreen, but mix five of them and flip them to the screen every fifth frame, to achieve 60Hz. This will give you pretty realistic motion blur.

Using 5 Sprites may be too slow, so you better use only one sprite that is produced the same way as in the delay effect mentioned before. It may be a little tricky to find the right alpha value for the sprite to get a uniform presence for each frame of the 5 frames.

Such an effect is especially easy to program on fixed hardware like on a console, where you know how fast it will run. On a PC you probably need to use a custom number of "frames per frame" for this kind of motion blur.

There may be other tricks to do motion blur, that I don't know.


Gamzman(Posted 2006) [#5]
Thank you jfk, I understand it now :)


Sir Gak(Posted 2006) [#6]
Yeah, even if YOUR hardware can run 300 fps, that doesn't necessarily mean the other fellow's machine/hardware can, too (assuming you intend for others to use your prog.) I like the suggestion of using alpha, so as to create a "trail" of images, hence motion blur.


jfk EO-11110(Posted 2006) [#7]
an alternative way would be to render the 5 frames that build the blured frame with a very low camera range, so only the very near things will be motion blured. This may be useful in a car racing sim, like eg. in burnout revenge, where the blur happens mainly on the screen borders.

so let's say 4 frames are rendered ith a camera range of 10,12,14 and 16, and the fith frame will use the full range, 2000 or whatever scale the design requires. The fifth frame is fully opaque, serving as the background, the other "border-frames" will use alpha.

Only an idea so far. Could be pretty fast.