Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Ripple Effect

Discussion in 'Made With Unity' started by destroyerhst, Jul 26, 2009.

  1. destroyerhst

    destroyerhst

    Joined:
    May 5, 2009
    Posts:
    20
  2. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
  3. PrvtHudson

    PrvtHudson

    Joined:
    Apr 10, 2009
    Posts:
    236
    That is awesome looking. Thanx for sharing !!
     
  4. destroyerhst

    destroyerhst

    Joined:
    May 5, 2009
    Posts:
    20
  5. psychicparrot

    psychicparrot

    Joined:
    Dec 10, 2007
    Posts:
    884
    Awesome work! Thanks for sharing :)
     
  6. Alec

    Alec

    Joined:
    Mar 11, 2008
    Posts:
    1,330
    one word: f***ingawsome
     
  7. Discord

    Discord

    Joined:
    Mar 19, 2009
    Posts:
    1,008
    Very very cool. One of the best fluid simulations I've seen.
     
  8. tinmanassets

    tinmanassets

    Joined:
    Jan 6, 2009
    Posts:
    61
    Hey, that's mine! :)

    Thanks for all the nice comments! :)

    You can read about it on my blog (the link at the top, by destroyerhst) but it was really a very simple algorithm. And the code is all there too, so go big!

    Cheers!
    -Ben
     
  9. Maker16

    Maker16

    Joined:
    Mar 4, 2009
    Posts:
    779
    I'm thinking this could actually be modified to generate large impact waves on terrain (ie - when an asteroid hits..or any blast wave, for that matter). You'd just need to sample the terrain heigth at each step and make sure the wave's height doesn't exceed the wave height relative to the terrain heigth at the center of impact. That way, it would travel over uneven terrain realistically. Throw in a particle emitter that expands with the wave (there'd be only one) to handle the ejecta, and you might be able to create some Armageddon/Deep Impact (and any other silly asteroid-killing-the-Earth movie) effects.
     
  10. destroyerhst

    destroyerhst

    Joined:
    May 5, 2009
    Posts:
    20
    Ask Unity developers maby they implement fuid effect on next verion :)
     
  11. Sammer

    Sammer

    Joined:
    May 1, 2009
    Posts:
    49
    Very Nice! Thanks for sharing.
     
  12. Sandor

    Sandor

    Joined:
    Apr 17, 2009
    Posts:
    91
    Hey Ben ;-)

    http://workflow.cd-cologne.de/download/unity/webfish.html

    her's also a small preliminary demo of the fishes (no interaction yet with the fishes). I think that specially for water-ripples it would be better to use a texture and feed it back in the refraction channel of the shader instead of the physical deformation of the plane... At least for the pro version ;-)

    Was away for two weeks (hollydays ;-) - will contact you later this week...

    Cheers,

    Sandor
     
  13. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    That's pretty cool, Sandor! :)
     
  14. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Nice. I've used that algorithm before myself, and you can make the waves reflect off of any surface; not just the boundaries of the simulation rectangle:

    http://runevision.com/3d/anims/#45

    The trick is to simply not perform the simulation for cells that are outside the body of water (they should keep a value of 0 and not be affected by neighbors). Then the rest works all by itself. (This is the same thing that happens for the rectangle edges.)

    Rune
     
  15. Sandor

    Sandor

    Joined:
    Apr 17, 2009
    Posts:
    91
    thanks bigkahuna ;-) I will post some more things regarding the fishes when they are finished (i will have to finish the project in august). The point is that it is a MultiTouch application (using TUIO) an it will run on our tables... Also the fishes will react if you are touching them. Will post some videos here also...

    Rune: that's freaking awesome man! Would it be possible for you to extend Ben's code? I think that it would be a very nice enhancement for this community...
     
  16. patchfactory

    patchfactory

    Joined:
    Feb 1, 2010
    Posts:
    6
    I know this is old ,but just cant help to say how great it is and here is the JS version I ported, in case some one needed. I did some small modification so the water ripple is more look realistic ( multiple ripples).
    here is the video that I apply effect to my multitouch screen:
    http://www.youtube.com/watch?v=AycJOOoBqj4
     

    Attached Files:

  17. defmech

    defmech

    Joined:
    Feb 24, 2007
    Posts:
    506
    Now make a parallax map for that stone texture, add some caustics from the ripples and you've got one awesome puddle simulator :)
     
  18. Sandor

    Sandor

    Joined:
    Apr 17, 2009
    Posts:
    91
    Hey patchfactory,

    looking nice the video :) What exactly did you changed in the code - you are saying "multiple ripples" - or do you mean you are creating multiple ripples (multitouch)?

    Cheers Keep it up,
     
  19. patchfactory

    patchfactory

    Joined:
    Feb 1, 2010
    Posts:
    6
    Ok, the thing is simple, in real world, when you drop something into water, normally there will multiple rings, so I simply add few more rings after one click. :D how simple is that. LOL
     
  20. Matkins

    Matkins

    Joined:
    Aug 24, 2009
    Posts:
    152
    Does anyone know how I could apply this affect to a sphere mesh? I think the trickiest things are sorting out the order of the vertices, and making it wrap around as opposed to bouncing off the supposed edges.
     
  21. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    Wow, that is amazing. Great job.
     
  22. Axel-F

    Axel-F

    Joined:
    Mar 20, 2009
    Posts:
    223
    I wonder what kind of texture / shader works best for creating a transparency water effect with Bens code. Like the one in the fish demo (what looks great!). Any idea?
     
  23. KillerSneak

    KillerSneak

    Joined:
    Jan 9, 2011
    Posts:
    38
    looks to me you followed NeHe's tutorials on this? (could be wrong) but I used the same effect several years ago (with the help of NeHe's tutorials) but could never get a reflection to work on the watter with the ripples so I stopped working on a custom OpenGL engine (was just for fun/learning purposes)
     
  24. chechoggomez2

    chechoggomez2

    Joined:
    Jul 28, 2009
    Posts:
    9
  25. aarora2

    aarora2

    Joined:
    Aug 2, 2011
    Posts:
    11
    Hello to all,

    Can someone suggest me how i can give ripple effect to water when some object collide with that water plane on which there is some texture of water?

    Thanks.
     
  26. NickChalvatzakis

    NickChalvatzakis

    Joined:
    Sep 19, 2011
    Posts:
    14
  27. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I could def use something like this on my atlantis stage, where there is a huge ocean and I would want rippling when the characters colliding into it...
     
  28. g2mediagroup

    g2mediagroup

    Joined:
    Jun 25, 2011
    Posts:
    98
    Can someone modify the code to allow ripple from collision of rigidbody/collider game objects?

    Thanks!
     
    Last edited: Oct 10, 2011
  29. g2mediagroup

    g2mediagroup

    Joined:
    Jun 25, 2011
    Posts:
    98
    Ok, got this function to work...kinda...weird anomaly of water "mounding" in one spot and all the ripples seem to originate from that point...hmmmm

    Any thoughts?
     
  30. abgamers

    abgamers

    Joined:
    Dec 22, 2009
    Posts:
    97
    Thats super dude.

    Thanks for sharing it with everyone :)
     
  31. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,259
    I've been playing with this code a bit, and it works great, just what I wanted. One thing I can't figure out, is how to change the frequency of the wave. The wave is very low frequency as is, and I'd like to increase it, but don't see any variable that affects frequency.
     
  32. Yippie

    Yippie

    Joined:
    May 4, 2009
    Posts:
    227
    really nice :D you should make a game with it
     
  33. seba88

    seba88

    Joined:
    May 23, 2013
    Posts:
    4

    hey man, sorry for the silly question...I'm tryng to use your script, but where should I connect it? a piano, camera? thx :)