0 Favourites

[Discussion] Motion Blur

  • Hey, as no one made a motion blur effect for construct, I'm trying to do it on my own.

    Anyway, I'm new to javascript, so I got a few questions.

    I've made some researches on how the effect should work, and I found that what the effect does is:

    1- Copies the canvas (or whatever name you call it, the part of the game that is currently displayed on screen)

    2- Adds to it some blurry effect

    3- After 1 frame, blends it to the current canvas

    4- Go back to step one.

    So, I know how to blend images.

    I kinda know how to add that blurry effect.

    But, the whole problem is that I neither know how to "copy" the canvas nor how to "wait" 1 frame

    Could some awesome javascripter help me with this one? ^^

  • When you say "motion blur", do you mean creating a trail?

  • Yes, something like this : (add https)://www.scirra.com/forum/request-directional-blur_t122854

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Here's how I approached it in a recent game. I created a semi-transparent copy of the player object (named it Trail) and gave it fade behavior. Set it to active. Set it destroy after fade out. Set the fade out time to 0.5 seconds.

    On Some condition> (create a sub event)

    ______System> Every 0.06 seconds > Player Spawn Trail ( on layer below the Player's layer)

    As the Player object moves it creates a trail. You can adjust the timing parameters for the desired effect. In my case, I created a transparency (Trail) at 30% of the original Player Object.

    Worked well for me. Good Luck

  • What I did personally, is redoing what the dude in the post I've shown in my previous message. The result is quite satisfying

  • TheDom

    skymen

    Iv'e 90% finished a fx shader that looks half decent. Here's a screen grab-

    The problem is passing info from the player input...keyboard press etc.

  • Out of curiosity what would be the best practice for this, performance wise?

    A. Spawning sprite instances.

    B. Using a shader.

    C. Pasting to the canvas/paster plugin.

    Of course while all the parameters and draw calls are exactly the same.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)