New Motion Blur Technique

Blitz3D Forums/Blitz3D Programming/New Motion Blur Technique

ClayPigeon(Posted 2012) [#1]
I accidentally created a new motion blur technique that is surprisingly fast. The rendering steps are as follows:

1. Give everything in the world an alpha transparency value < 1 (I haven't figured out a good way of choosing that number yet)

2. CaptureWorld at the beginning of the frame.

3. Set CameraClsMode to True,True to make sure the screen is cleared.

4. Perform the first RenderWorld to cover up last frame's RenderWorld.

5. Set CameraClsMode to False,True.

6. Use a For loop and let 'i' go from 0 to 1 with the desired Step size. RenderWorld each loop, letting 'i' be the tween value. (smaller step sizes make more realistic motion blur, but cause more frames to be rendered, are therefore, more lag)


Here's an example render cycle using this technique:

CameraClsMode Camera,True,True
RenderWorld 0
CameraClsMode Camera,False,True
For i#=0.1 To 1 Step 0.1
	RenderWorld i
Next


This will perform ten consecutive RenderWorld calls, which looks already very realistic. It may look slow, but it is much faster than older methods, most of which involve CopyRect-ing a lower resolution render to a texture and slapping it on a quad in front of everything else which looks a little strange. This, however, renders directly to the screen, just how it was meant to be used. Just thought I would share this in case anyone really wants nice looking motion blur. Auf wiedersehen, mi amigos!

EDIT: In a perfect world, using additive blending would make this effect look 100% correct, but due to color depth issues, this causes nasty color artifacts and stepping, so for now, stick with EntityAlpha.

Last edited 2012