dcsimg
A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: motion blur effect

  1. #1
    3DFA hobby scripter LewxX²'s Avatar
    Join Date
    Jul 2006
    Location
    Germany, Karlsruhe
    Posts
    198

    motion blur effect

    Does anyone know how to make an effect like in that game?

    http://www.kongregate.com/games/Stuv/shape-wars
    sorry for my bad school English
    btw. visit my Page: projects.lewxx.de
    or lewxx.de (<= German)

  2. #2
    Member
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    76
    It looks like the elements are drawn in a bitmapData object and on every second a blur filter is applied on it.

    It could also be possible that the elements will be cloned and blurred to make such an effect.

    If you want to know how it works with the bitmapData, I will have to do some experiments first. I think I can explain it to you on the weekend.

  3. #3
    3DFA hobby scripter LewxX²'s Avatar
    Join Date
    Jul 2006
    Location
    Germany, Karlsruhe
    Posts
    198
    cool, thx!
    sorry for my bad school English
    btw. visit my Page: projects.lewxx.de
    or lewxx.de (<= German)

  4. #4
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    That "motion" blur or recursive blurring is quite easy and there is few example floating around.. However I run into some trouble making a 3dfa example so no demo yet

    nonworking code basics of recursive blur:
    ...for every frame...
    // draw you stuff in stage..
    ....
    // copy stage to bitmap
    bmpMain.draw(stage);
    // apply blurring and colormatrix if needed (like if you like fade color values )
    bmpMain.applyFilter(bmpMain,rectMain,pntOrigin,blu r);
    bmpMain.applyFilter(bmpMain,rectMain,pntOrigin,col orMatrix);

  5. #5
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    Ok, I got it working in flash export... demo movie included:
    Attached Files Attached Files

  6. #6
    3DFA hobby scripter LewxX²'s Avatar
    Join Date
    Jul 2006
    Location
    Germany, Karlsruhe
    Posts
    198
    Wow thanks,
    with that code I can make so many effects possible.

    e.g: this test (blur.movie)
    Last edited by LewxX²; 03-20-2008 at 02:19 PM.
    sorry for my bad school English
    btw. visit my Page: projects.lewxx.de
    or lewxx.de (<= German)

  7. #7
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    For whole stage blur try 3dfa clones sample and add..
    this at the start of the starting script:

    Code:
    var buf = new Bitmap();
    addChild(buf);
    swapChildren(buf,element ("ball"));
    blur = new BlurFilter(4, 4, 1);
    buf.bitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, false, 0x000000);
    and this to "on every frame" script:

    Code:
    buf.bitmapData.draw(stage);
    buf.bitmapData.applyFilter(buf.bitmapData, new Rectangle(0,0,stage.stageWidth, stage.stageHeight), new Point(0,0), blur);

  8. #8
    3DFA hobby scripter LewxX²'s Avatar
    Join Date
    Jul 2006
    Location
    Germany, Karlsruhe
    Posts
    198
    awesome!

    I've created a new movie, too:
    here (and here the .movie file)

    BTW:
    where do you get the "new BlurFilter()" filter-syntax from?

    I can't find a filter list in 3DFA
    Last edited by LewxX²; 03-20-2008 at 05:46 PM.
    sorry for my bad school English
    btw. visit my Page: projects.lewxx.de
    or lewxx.de (<= German)

  9. #9
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    From Adobe flash9/as3 doc website http://livedocs.adobe.com/flash/9.0/...riptLangRefV3/

    It is bit slow from there but I think there is pdf version available from this page.. http://www.adobe.com/support/documentation/en/flash/

  10. #10
    Senior Member Zoranan's Avatar
    Join Date
    May 2008
    Posts
    126
    awesome blur effects!

  11. #11
    3DFA hobby scripter LewxX²'s Avatar
    Join Date
    Jul 2006
    Location
    Germany, Karlsruhe
    Posts
    198
    Yeah i just love what can be done with these effect ^^
    sorry for my bad school English
    btw. visit my Page: projects.lewxx.de
    or lewxx.de (<= German)

  12. #12
    Senior Member Zoranan's Avatar
    Join Date
    May 2008
    Posts
    126
    I want to use this effect in a game, but the blur trail is too long! How can I make it "Dissolve" faster so that the trail is shorter?

    Zoranan

  13. #13
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    use colortransform after blurring:

    var r1 = new Rectangle(0,0,stage.stageWidth, stage.stageHeight)
    // check 3dfa colortransform help....
    var ct1 = new ColorTransform (0.99, 0.99, 0.99, 0, 0, 0, 0, 0);

    buf.bitmapData.colorTransform (r2, ct1);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center