Code archives/3D Graphics - Effects/Super fast full screen motion blur.

This code has been declared by its author to be Public Domain code.

Download source code

Super fast full screen motion blur. by Proger
(Posted 23 years ago)
Demo with full source code:

http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=arkon200412082003152343&comments=no
Global ark_blur_image, ark_blur_texture, ark_sw, ark_sh

Function CreateBlurImage()
	;Create blur camera
	Local cam = CreateCamera()
	CameraClsMode cam, 0, 0
	CameraRange cam, 0.1, 1.5
	MoveEntity cam, 0, 0, 10000

	ark_sw = GraphicsWidth()
	ark_sh = GraphicsHeight()
	
	
	;Create sprite
	Local spr = CreateMesh(cam)
	Local sf = CreateSurface(spr)
	AddVertex sf, -1, 1, 0, 0, 0
	AddVertex sf, 1, 1, 0, 1, 0
	AddVertex sf, -1, -1, 0, 0, 1
	AddVertex sf, 1, -1, 0, 1, 1
	AddTriangle sf, 0, 1, 2
	AddTriangle sf, 3, 2, 1
	EntityFX spr, 17
	ScaleEntity spr, 1024.0 / Float(ark_sw), 1024.0 / Float(ark_sw), 1
	PositionEntity spr, 0, 0, 1.0001
	EntityOrder spr, -100000
	EntityBlend spr, 1
	ark_blur_image = spr
	
	;Create blur texture
	ark_blur_texture = CreateTexture(1024, 1024, 256)
	EntityTexture spr, ark_blur_texture
End Function

Function UpdateBlur(power#)
	EntityAlpha ark_blur_image, power#
	CopyRect  ark_sw / 2 - 512, ark_sh / 2 - 512, 1024, 1024, 0, 0, BackBuffer(), TextureBuffer(ark_blur_texture)	
End Function

Comments

Kornflex
(Posted 23 years ago)
The link for DL the full demo it's down ?

Regards,

BlitzSupport
(Posted 23 years ago)
Now that we can post comments, I just want to say that this kicks ass -- and it's so easy to plug into existing code! Thanks Arkon.

Ziltch
(Posted 23 years ago)
Thanks for this blur code. It is great!

I found modifing these lines centred the blur and gave more options.

	PositionEntity spr, -0.0015, 0.0015, 1.0001; adjust Z plane for blur in/out. <1 = in, >1 = out
	EntityBlend    spr, 3

With the EntityBlend change you also need to have a lower UpdateBlur(power#) power# value, i.e. .49

Thanks again

Dirk Krause
(Posted 23 years ago)
Does anybody have the link to the full download? As Kornflex stated it is down.

Regards,
Dirk

Dirk Krause
(Posted 23 years ago)
Does anybody have the link to the full download? As Kornflex stated it is down.

Regards,
Dirk

Cygnus
(Posted 22 years ago)
this is THE best function ive EVER come across for visual effects... just.... WOW

ive replaced my blur routines with it now! this drokin' rocks!!! :D

Jeremy Alessi
(Posted 22 years ago)
Nicely optimized version of what I had before!

Proger
(Posted 22 years ago)
I update link for this demo!

http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=arkon200412082003152343&comments=no

danjamwoo
(Posted 21 years ago)
Broken...

Naughty Alien
(Posted 21 years ago)
..dead link...

Boiled Sweets
(Posted 21 years ago)
Could someone please post this again in the code archives?

John Blackledge
(Posted 21 years ago)
Yes please. Post again. Dead link.

Mikele
(Posted 21 years ago)
[DELETED]

Naughty Alien
(Posted 21 years ago)
.thanks Mikele

John Blackledge
(Posted 21 years ago)
Stunning!

Avrigus
(Posted 21 years ago)
The pre compiled .exe works great but when I compile the code myself and ramp up the blur ammount the blur starts smearing diagonally down towards the right of the screen. Has anyone else encountered this?

VP
(Posted 21 years ago)
Download re-hosted here because it downloads very slowly from the link supplied by Mikele.

Sorry Mikele, but wherever it is you're hosting it doesn't seem to have a lot of bandwidth ;)

Mikele
(Posted 21 years ago)
Hmm... i don't know why... i have 120 KB/s from that server (maybe bandwith is limited outside my country).
Sorry :)

P.Weijtenburg
(Posted 20 years ago)
pff.. 3 dead links. any ideas?

WendellM
(Posted 20 years ago)
I found a copy from a few years ago sitting in my Blitz folder:
http://neonavis.com/blur.zip

Kryzon
(Posted 18 years ago)
No offense, the effect does look nice. But it really isn't motion blur - you are using frames you already showed the user to mix up and get the result. That classifies this as Ghosting.

In order for it to be really motion blur, you'd have to render in-between frames with a certain tweening (meaning each subframe has a tween of 1/number of subframes), and then mix THAT up and show the user. That would be classified as the temporal-exposure that occurs with camera shutters, AKA motion-blur.

Code Archives Forum