A Better Ripple Effect. Now with source code!

I wanted to make a ripple effect that distorted the image more realistically. The trick is coming up with the right displacement map. In the displacement map, one color channel controls x-axis displacement and another controls y-axis displacement. Here is an example of what I came up with. This is generated algorithmically.
Displacement Map

Download the source code.

10 Comments

  1. hm says:

    how can I get the source code for this?

  2. admin says:

    By asking! Download it using the link above.

  3. bk says:

    How would I modify the code so the effect is an ellipse, not a circle?

  4. ollie says:

    Hey, how easy would it to be to use a custom shape to create the ripple filter?

  5. theSquishySteve says:

    Hi there, amazing work with this! I have a question though… I would like to use this effect, to create a ripple, upon clicking a button, as if the button was slightly under water.

    However, I receive the following error when trying this: “Call to a possibly undefined method Point.

    Any advice as to how to do this would be fantastic!

  6. Stick says:

    Mr. Brill, I’d been banging my head about multiple instances of animated DMFs (instantiated from a custom class I’d been working on) for probably four or five hours last night: I just couldn’t figure out how to prevent adding a new instance from totally ruining any preexisting instances. I took a closer look at your code, and I’ve just gotta say: the idea of using the DMF’s color property as an identifier was brilliant! Borrowing oh-so-modestly from your code, I updated my own and it works as advertised! Consider your praises sung!!! :) (And thanks!)

  7. pete says:

    Hi – this is a great effect. I’ve read your code and seen that it says it is free for use. Just thought I’d double check that it is OK to use it in a commercial project I’m doing. Thanks, Pete

  8. T says:

    Was looking for this exact effect; very nicely implemented. thanks so much for sharing!

  9. Ed H says:

    hey there!
    Thanks for the source. The effect is great.

    Question:
    How could i modify the code to make it work with mouse roll_over action?

    Thanks!

  10. Hi there, amazing work with this! I have a question though… I would like to use this effect, to create a ripple, upon clicking a button, as if the button was slightly under water. However, I receive the following error when trying this: “Call to a possibly undefined method Point. Any advice as to how to do this would be fantastic!

Leave a Reply