Ooops
October 28, 2020, 06:06:37 AM

Author Topic: [bb] Super fast full screen motion blur. by Proger [ 1+ years ago ]  (Read 1714 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
Title : Super fast full screen motion blur.
Author : Proger
Posted : 1+ years ago

Description : Demo with full source code:

<a href="http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=arkon200412082003152343&comments=no" target="_blank">http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=arkon200412082003152343&comments=no[/url]


Code :
Code: BlitzBasic
  1. Global ark_blur_image, ark_blur_texture, ark_sw, ark_sh
  2.  
  3. Function CreateBlurImage()
  4.         ;Create blur camera
  5.         Local cam = CreateCamera()
  6.         CameraClsMode cam, 0, 0
  7.         CameraRange cam, 0.1, 1.5
  8.         MoveEntity cam, 0, 0, 10000
  9.  
  10.         ark_sw = GraphicsWidth()
  11.         ark_sh = GraphicsHeight()
  12.        
  13.        
  14.         ;Create sprite
  15.         Local spr = CreateMesh(cam)
  16.         Local sf = CreateSurface(spr)
  17.         AddVertex sf, -1, 1, 0, 0, 0
  18.         AddVertex sf, 1, 1, 0, 1, 0
  19.         AddVertex sf, -1, -1, 0, 0, 1
  20.         AddVertex sf, 1, -1, 0, 1, 1
  21.         AddTriangle sf, 0, 1, 2
  22.         AddTriangle sf, 3, 2, 1
  23.         EntityFX spr, 17
  24.         ScaleEntity spr, 1024.0 / Float(ark_sw), 1024.0 / Float(ark_sw), 1
  25.         PositionEntity spr, 0, 0, 1.0001
  26.         EntityOrder spr, -100000
  27.         EntityBlend spr, 1
  28.         ark_blur_image = spr
  29.        
  30.         ;Create blur texture
  31.         ark_blur_texture = CreateTexture(1024, 1024, 256)
  32.         EntityTexture spr, ark_blur_texture
  33. End Function
  34.  
  35. Function UpdateBlur(power#)
  36.         EntityAlpha ark_blur_image, power#
  37.         CopyRect  ark_sw / 2 - 512, ark_sh / 2 - 512, 1024, 1024, 0, 0, BackBuffer(), TextureBuffer(ark_blur_texture)  
  38. End Function


Comments :


Kornflex(Posted 1+ years ago)

 The link for DL the full demo it's down ?Regards,


BlitzSupport(Posted 1+ 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 1+ years ago)

 Thanks for this blur code. It is great!I found modifing these lines centred the blur and gave more options.
Code: [Select]
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 1+ years ago)

 Does anybody have the link to the full download? As Kornflex stated it is down.Regards,  Dirk


Dirk Krause(Posted 1+ years ago)

 Does anybody have the link to the full download? As Kornflex stated it is down.Regards,  Dirk


Damien Sturdy(Posted 1+ years ago)

 this is THE best function ive EVER come across for visual effects... just.... WOWive replaced my blur routines with it now! this drokin' rocks!!! :D


Jeremy Alessi(Posted 1+ years ago)

 Nicely optimized version of what I had before!


Proger(Posted 1+ years ago)

 I update link for this demo!<a href="http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=arkon200412082003152343&comments=no" target="_blank">http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=arkon200412082003152343&comments=no[/url]


daaan(Posted 1+ years ago)

 Broken...


Naughty Alien(Posted 1+ years ago)

 ..dead link...


Boiled Sweets(Posted 1+ years ago)

 Could someone please post this again in the code archives?


John Blackledge(Posted 1+ years ago)

 Yes please. Post again. Dead link.


Mikele(Posted 1+ years ago)

 [DELETED]


Naughty Alien(Posted 1+ years ago)

 .thanks Mikele


John Blackledge(Posted 1+ years ago)

 Stunning!


Avrigus(Posted 1+ 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 1+ years ago)

 Download re-hosted <a href="http://www.zen72251.zen.co.uk/files/blur.zip" target="_blank">here[/url] 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 1+ years ago)

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


Trader3564(Posted 1+ years ago)

 pff.. 3 dead links. any ideas?


WendellM(Posted 1+ years ago)

 I found a copy from a few years ago sitting in my Blitz folder:<a href="http://neonavis.com/blur.zip" target="_blank">http://neonavis.com/blur.zip[/url]


Kryzon(Posted 1+ 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. [/i]

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal