Thanks, This was really good..
Code archives/3D Graphics - Effects/Motion Blur
This code has been declared by its author to be Public Domain code.
Download source code
| This is a very small lib that with tweaking can do some really neat things. I have a demo that you can download which has complete source and a simple example. http://www.hi-toro.com/blitz/MotionBlur.rar http://www.hi-toro.com/blitz/MotionBlur.zip Also, please vote for my gallery screenshot at http://blitzbasic.com/gallery/view_pic.php?id=1193&gallery=&page=1 |
; l_surface by Daniel Wooden ; Created : 10/25/2005 Global l_surface = CreateSprite( camera ) SpriteViewMode l_surface, 2 PositionEntity l_surface, 0, 0, 0.00638 ScaleSprite l_surface, 0.0064, 0.0048 EntityAlpha l_surface, 0.5 Global l_texture = CreateTexture( 640, 480, 1+256 ) ScaleTexture l_texture, 1.598, 1.066 TextureBlend l_texture, 2 EntityTexture l_surface, l_texture Function l_update() RenderWorld CopyRect 0, 0, 640, 480, 0, 0, BackBuffer(), TextureBuffer( l_texture ) End Function Function l_setAlpha( a# ) EntityAlpha l_surface, a# End Function |
Comments
Excellent effect, very nicely presented. I'd already given the gallery image a 5/5. ...and thanks for the preview! :)
Cool effect!
I was experimenting a bit and got it to work with other width/height values than 640x480, and the sprite is now 1 unit away from the camera so you don't have to make the CameraRange near# value as small:
Global l_surface=CreateSprite(camera)
Global width=GraphicsWidth(),height=GraphicsHeight()
SpriteViewMode l_surface,2
PositionEntity l_surface,0,0,1
EntityOrder l_surface,-100
ScaleSprite l_surface, 1, 0.75
Global l_texture=CreateTexture(width,Height,1+256)
TextureBlend l_texture,2
ScaleTexture l_texture, (Float TextureWidth(l_texture)/Float width),(Float TextureHeight(l_texture)/Float Height)
EntityTexture l_surface,l_texture
EntityAlpha l_surface,.3
Function l_setAlpha(alpha#)
EntityAlpha l_surface,alpha#
End Function
Function l_update()
RenderWorld
CopyRect 0,0,width,Height,0,0,BackBuffer(),TextureBuffer(l_texture)
End Function
I was experimenting a bit and got it to work with other width/height values than 640x480, and the sprite is now 1 unit away from the camera so you don't have to make the CameraRange near# value as small:
Global l_surface=CreateSprite(camera)
Global width=GraphicsWidth(),height=GraphicsHeight()
SpriteViewMode l_surface,2
PositionEntity l_surface,0,0,1
EntityOrder l_surface,-100
ScaleSprite l_surface, 1, 0.75
Global l_texture=CreateTexture(width,Height,1+256)
TextureBlend l_texture,2
ScaleTexture l_texture, (Float TextureWidth(l_texture)/Float width),(Float TextureHeight(l_texture)/Float Height)
EntityTexture l_surface,l_texture
EntityAlpha l_surface,.3
Function l_setAlpha(alpha#)
EntityAlpha l_surface,alpha#
End Function
Function l_update()
RenderWorld
CopyRect 0,0,width,Height,0,0,BackBuffer(),TextureBuffer(l_texture)
End Function
Simple, but effective, great job! The Screenshot it awesome!
very awesome!
Cool :)
Has anyone tried adjusting this for multiple cameras by the way? e.g. 2 player split screen. Guess its a case of having x2 sprites one per cam etc.
Has anyone tried adjusting this for multiple cameras by the way? e.g. 2 player split screen. Guess its a case of having x2 sprites one per cam etc.
um does anyone have the demo for this
can someone refresh the link ?
Does anyone have the demo for this?